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:
a group of instructions that can be used to organize a program or perform a repeated task
Explanation:
A function is a group of commands that can be called upon with extra parameters if needed.
Example:
def foo(): #defining this function and naming it foo
return True #what is performed when foo is called on
if foo() == True: #foo() is calling on a function named foo
print('yes')
Answer:
a. A nonconstant pointer to nonconstant data
Explanation:
Pointer can be used to pass an argument by reference. Pointers may be assigned to any integer value. Functions parameters are passed by an array. The function which modifies an array by arithmetic pointer is nonconstant pointer to nonconstant data to process every value in array. Pointer arithmetic allows us to perform integer additions or subtractions for the operation in pointer.
Answer:
Lactic acid
Explanation:
Lactic acid builds up during strenuous exercise with limited amounts of oxygen.