← Back
Code Challenge 1.9 - Time Display
Objective
Create a console application that prompts the user to enter an hour value, a minute value, and either AM or PM. The program will then format and display the time in the correct format.
Skills to Practice
- Prompting a user for input
- Formatting output
Challenge Tasks
- Create a console project named Challenge 1-9.
- Prompt the user to input three pieces of data: hours, minutes, and either AM or PM.
- Format and display the time in a clear and readable manner.
Sample Output
Enter the hours value: 9 [Enter]
Enter the minutes value: 30 [Enter]
Enter AM or PM: AM [Enter]
Time: 9:30 AM