This program is in C++ for intermediate. Please help for VS code for MacBook Air.
Posted: Mon Jun 06, 2022 1:50 pm
This program is in C++ for intermediate. Please help for VS
code for MacBook Air.
Write a program that prompts the user to enter time in 12-hour notation. The program then outputs the time in 24-hour notation. Your program must contain three exception classes: invalidHr, invalidMin, and invalidSec. If the user enters an invalid value for hours, then the program should throw and catch an invalid Hr object. Similar conventions for the invalid values of minutes and seconds. Sample Run Enter hours: 14 The value of hr must be between 0 and 12. Enter hours: -2 The value of hr must be between 0 and 12. Enter hours: 5 Enter minutes: 70 The value of minutes must be between 0 and 59. Enter minutes: 30 Enter seconds: -2
The value of seconds must be between 0 and 59. Enter seconds: 45 Enter AM or PM: AM 24 hour clock time: 5:30:45
code for MacBook Air.
Write a program that prompts the user to enter time in 12-hour notation. The program then outputs the time in 24-hour notation. Your program must contain three exception classes: invalidHr, invalidMin, and invalidSec. If the user enters an invalid value for hours, then the program should throw and catch an invalid Hr object. Similar conventions for the invalid values of minutes and seconds. Sample Run Enter hours: 14 The value of hr must be between 0 and 12. Enter hours: -2 The value of hr must be between 0 and 12. Enter hours: 5 Enter minutes: 70 The value of minutes must be between 0 and 59. Enter minutes: 30 Enter seconds: -2
The value of seconds must be between 0 and 59. Enter seconds: 45 Enter AM or PM: AM 24 hour clock time: 5:30:45