Question: Program One Write a program, named time.cpp that converts time in 24-hour notation as two integers one for hours and one for minutes and converts

 Program One Write a program, named time.cpp that converts time in

Program One Write a program, named time.cpp that converts time in 24-hour notation as two integers one for hours and one for minutes and converts it to 12-hour notation. Your program should implement 3 functions: one to get input from a data file, one to do the conversion, and one to do output the converted time Record the A.M./P.M. information as a char with the value'A' for AM or 'P' for PM. Pass the char as a call-by-reference formal parameter to the conversion function Your main function should open the data file and use a while loop to process the time stored in the file one by one. For each time, call the three user defined function to read, convert, and output the result. Navigate to your project directory under the codelite directory. Copy the data file into your project directory using the following Unix command cp cen/data/times.dat Here is an example of the data file 20:45 10:20 23:59 5:03 8:10 For this data file, the output from the program should be 8:45 PM 10:20 AMM 11:59 PM 5:03 AM 8:10 AM

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!