Answer:
import java.io.*;
public class Main
{
public static void main(String[] args) throws IOException {
BufferedReader bufferObject=new BufferedReader(new InputStreamReader(System.in));
String stringObject=bufferObject.readLine();
while(!stringObject.equals("99:99AM")){
System.out.println(convertedTime(stringObject));
stringObject=bufferObject.readLine();
}
}
public static String convertedTime(String stringObject){
String s=stringObject.substring(stringObject.length()-2);
String[] timeObject=stringObject.substring(0,5).split(":");
if(s.equals("AM")){
if(timeObject[0].equals("12")) return "00"+timeObject[1];
else return timeObject[0]+timeObject[1];
}
else{
if(timeObject[0].equals("12")) return "12"+timeObject[1];
else{
int hours=Integer.valueOf(timeObject[0]);
timeObject[0]=String.valueOf(12+hours);
return timeObject[0]+timeObject[1];
}
}
}
}
Explanation:
- Inside the main method run a while loop until stringObject is not equal to the string "99:99AM".
- Call the convertedTime method and display the results.
- Use the same hours and minutes except for 12th hour If the time is in AM.
- Use "00" instead of 12, if it is 12th hour.
- Add hours to 12, if the time is in PM and don't change anything in case of 12.
Answer:
it would have to be flow control which would be C.
Explanation:
Solution:
three reasons you might use hwinfo when troubleshooting and upgrading a computer are as follows:
1) If we want to identify a hardware component with out opening the case.
2. if we want identify Features of a motherboard, video card, or processor.
3. establish benchmarks for the components in
Answer:
See explaination please.
Explanation:
We are going to get a solution by making use of the instruction;
Given The instruction,
MOV EAX, AAAAAAAA
MOV EBX, BBBBBBBB
MOV ECX, CCCCCCCC
This is going to move the defined values, say AAAAAAAA, BBBBBBBB, CCCCCCCC, to the registers EAX, EBX, ECX, respectively
Now,
PUSH AX
This push instruction pushes the first 8 bits in register EAX, to a stack,
again, PUSH BX
Also this push instructions will also push the first 8 bits in register EBX, to the stack
PUSH CX
This push instruction pushes the first 8 bits in register ECX, to the stack,
similarly PUSH BX PUSH AX PUSH CX pushes the 8 bit registers in the same stck,
NOw, the instructions POP EAX POP EBX POP ECX
will lead to the contents of the respective registers as
EAX=CCCCAAAA EBX=CCCCBBBB ECX=AAAACCCC