Answer:
- public class Main {
- public static void main(String[] args) {
- String testString = "abscacd";
-
- String evenStr = "";
- String oddStr = "";
-
- for(int i=testString.length() - 1; i >= 0; i--){
-
- if(i % 2 == 0){
- evenStr += testString.charAt(i);
- }
- else{
- oddStr += testString.charAt(i);
- }
- }
-
- System.out.println(evenStr + oddStr);
- }
- }
Explanation:
Firstly, let declare a variable testString to hold an input string "abscacd" (Line 1).
Next create another two String variable, evenStr and oddStr and initialize them with empty string (Line 5-6). These two variables will be used to hold the string at even index and odd index, respectively.
Next, we create a for loop that traverse the characters of the input string from the back by setting initial position index i to testString.length() - 1 (Line 8). Within the for-loop, create if and else block to check if the current index, i is divisible by 2, (i % 2 == 0), use the current i to get the character of the testString and join it with evenStr. Otherwise, join it with oddStr (Line 10 -14).
At last, we print the concatenated evenStr and oddStr (Line 18).
Answer:
Change in entropy S = 0.061
Second law of thermodynamics is satisfied since there is an increase in entropy
Explanation:
Heat Q = 300 kW
T2 = 24°C = 297 K
T1 = 7°C = 280 K
Change in entropy =
S = Q(1/T1 - 1/T2)
= 300(1/280 - 1/297) = 0.061
There is a positive increase in entropy so the second law is satisfied.
Answer:
18.75in
Explanation:
Modulus of elasticity = Stress/Strain
Since stress = Force/Area
Given
Force = 1000lb
Area = 0.75sqin
Stress = 1000/0.75
Stress = 1333.33lbsqin
Strain
Strain = Stress/Modulus of elasticity
Strain = 1333.33/5,000,000
Strain = 0.0002667
Also
Strain = extension/original length
extension = 0.005in
Original length = extension/strain
Original length = 0.005/0.0002667
Original length = 18.75in
Hence the original length of the rectangular bar is 18.75in
Answer: 24 pA
Explanation:
As pure silicon is a semiconductor, the resistivity value is strongly dependent of temperature, as the main responsible for conductivity, the number of charge carriers (both electrons and holes) does.
Based on these considerations, we found that at room temperature, pure silicon resistivity can be approximated as 2.1. 10⁵ Ω cm.
The resistance R of a given resistor, is expressed by the following formula:
R = ρ L / A
Replacing by the values for resistivity, L and A, we have
R = 2.1. 10⁵ Ω cm. (10⁴ μm/cm). 50 μm/ 0.5 μm2
R = 2.1. 10¹¹ Ω
Assuming that we can apply Ohm´s Law, the current that would pass through this resistor for an applied voltage of 5 V, is as follows:
I = V/R = 5 V / 2.1.10¹¹ Ω = 2.38. 10⁻¹¹ A= 24 pA