Home / Expert Answers / Computer Science / c-visual-studios-write-a-program-that-converts-time-from-24-hour-notation-to-12-hour-notation-for-pa684

(Solved): c++visual studios Write a program that converts time from 24-hour notation to 12 -hour notation. For ...



c++
visual studios

student submitted image, transcription available below

student submitted image, transcription available below
Write a program that converts time from 24-hour notation to 12 -hour notation. For example, it should convert 14:25 to 2:25 PM. The input is given as two integers. There should be at least three functions, one for input, one to do the conversion, and one for output: void input( parameter_list); // reads the hours and minutes in 24-hour notation and returns them to main function. Ex: retum 14 and 25 to main void convert( parameter_list): // converts the hours from 24-hour notation to 12 -hour notation. Ex: 14 will be returned to main as 2 PM 12 in one parameter and PM in another) void output( parameter_list ): // prints the time in 12-hour notation to the screen. Ex: 2:25 PM Function "convert" records the AM/PM information as a value of type char. 'A' for and ' ' for PM. Thus, the "convert" function will have a call-by-reference formal parameter of type char to record whether it is AM or PM. (The function will have other parameters as well.) Include a loop in the main function that lets the user repeat this computation for new input values again and again until the user says he or she wants to end the program. Sample run: Microsoft Visual Studio Debug Console Enter 24 hour time in the format HH:MM Time in 12 hour format: 2:25 PM Enter or to continue, anything else quits. Enter 24 hour time in the format HH:MM 00: 12 Time in 12 hour format: 12:12 AM Enter or to continue, anything else quits. Enter hour time in the fomat HH:MM Time in 12 hour format: 3:45 AM. Enter or to continue, anything else quits. n


We have an Answer from Expert

View Expert Answer

Expert Answer


We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe