divider

Objective

Build a console program that asks the user to enter an hour, a minute, and whether it's AM or PM.

Then, format and display the time in a clear, readable way—just like a digital clock.

Skills to Practice

  • icon Prompting a user for input
  • icon Formatting text output
divider

Tasks

  • icon Create a new project named sprint-1-4
  • icon Complete the following tasks:
    • icon Ask the user to enter:
      • icon Hours
      • icon Minutes
      • icon AM or PM
    • icon Display the formatted time clearly in the console
divider

Sample Output

Sample Output
Enter the hours value: 9 [Enter]
Enter the minutes value: 30 [Enter]
Enter AM or PM: AM [Enter]
Time: 9:30 AM

Begin Sprint