Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

code and screenshot of output. Task #1 Character and String Class Methods 1. Cop

ID: 3714560 • Letter: C

Question

code and screenshot of output.

Task #1 Character and String Class Methods 1. Copy the files Time.java and TimeDemo.java 2. In the Time.java file, add conditions to the decision structure which validates the data. Conditions are needed that will a) Check the length of the string b) Check the position of the colon c) Check that all other characters are digits 3. Add lines that will separate the string into two substrings containing hours and minutes. Convert these substrings to integers and save them into the instance variables. 4. In the TimeDemo class, add a condition to the loop that converts the user's answer to a capital letter prior to checking it. 5. Compile, debug, and run. Test out your program using the following valid input: 00:00, 12:00, 04:05, 10:15, 23:59, 00:35, and the following invalid input: 7:56, 15:78, 08:60, 24:00, 3e:33, 1:111. s below:

Explanation / Answer

Hi Dear,

You have not posted Time.java and TimeDemo.java.

I have implemeted my own.

Output:

Enter a military time using the ##:## format:
w2:30
w2:30 is not a valid miliary time.
Do you want to enter another (Y/N)?
30:30

Process finished with exit code 0