Complete and fully test the class Time that Exercise 2 describes. Add two more constructors that are analogous to the setTime methods described in Parts c and d of Exercise 2. Also include the following methods:
• getTime24 returns a string that gives the time in 24-hour notation hhmm. For example, if the hour value is 7 and the minute value is 25, return "0725". If the hour value is 0 and the minute value is 5, return "0005". If the hour value is 15 and the minute value is 30, return "1530".
• getTime12 returns a string that gives the time in 12-hour notation h:mm xx. For example, if the hour value is 7 and the minute value is 25, return "7:25 am". If the hour value is 0 and the minute value is 5, return "12:05 am". If the hour value is 15 and the minute value is 30, return "3:30 pm".
This project is a continuation of Exercise 2. The conversion from military time (24 hour format) to civilian time (12 hour format) is not difficult, but it is tricky. Having the students construct a table with corresponding times for both formats may help. The test cases for the class are in the main method.
See the code in Time.java.
You might also like to view...
In the Windows Task Manager, in the Applications tab, when a program is responding in an appropriate manner, the status will be displayed as:
A) Running B) Responding C) Processing D) Enabled
A PIN is a four-digit numeric pass code
Indicate whether the statement is true or false
Case-Based Critical Thinking QuestionsCase 10-1Elaina is the database administrator for a women's fitness franchise. She has been asked to automate several of the database functions to make it easier for the front desk employees to provide information to clients. Elaina will create macros to automate the functions. As Elaina continues to automate the database, she discovers that several of her macros are related. To make maintenance of the database more manageable, she decides to create ____ within a macro to consolidate the related macros.
A. actions B. event properties C. submacros D. event procedures
Computers in traffic lights, at supermarket checkouts, and in appliances are examples of ______ computers.
a. personal b. portable c. embedded