Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Programming Help Design a C++ program that will use functions to accomplish the following read each data set from the file (via Linux redirection)

C++ Programming Help

Design a C++ program that will use functions to accomplish the following

read each data set from the file (via Linux redirection)

display start time, end time, and length of interval between labeled and in the specified format

continue processing data sets until the end of file is encountered

Output Requirements

For each data set in the file, display the start and end times followed by the length of the defined interval with appropriate labels.

All times must be displayed in the form: hh:mm (leading zeroes must be output). For example, an input time of 4:05 must be displayed as 04:05.

If the times are given using the 12-hour clock, each time must be followed by "am" or "pm" (whichever is appropriate). For example, an input time of 6:01 P must be displayed as 06:01pm. Times must be displayed in the commonly accepted form (minutes will be between 00 and 59).

Length of time interval must be displayed in the form: hh:mm (leading zeroes must be output). For example 1 hour 7 minutes must be displayed as 01:07.

image text in transcribed

Sample terminal session I abobby 17FA]$ more data4three 12 8:28 a 11:35A 24 5:30 14:52 24 00:00 23:59 12 06:05A 4:01 data file 5@bobby 17FA$ [ 5@bobby 17FA]$ make assigne3 g++ assign03.cpp-o assign03 @bobby 17FA]$ ./assign@3 data4three Lec Sec# 1019, Lab Sec# 1021, #3 Start time: 08:28am Start time: 05:30 Start time: 00:00 Start time: 06:05am [ @bobby 17FA]$ I @bobby 17FAI$I End time: 11:35am End time: 14:52 End time: 23:59 End time: 04:01pm Interval length: 03:07 Interval length 09:22 Interval length: 23:59 Interval length: 09:56

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intranet And Web Databases For Dummies

Authors: Paul Litwin

1st Edition

0764502212, 9780764502217

More Books

Students also viewed these Databases questions

Question

How do Dimensional Database Models differ from Relational Models?

Answered: 1 week ago

Question

What type of processing do Relational Databases support?

Answered: 1 week ago

Question

Describe several aggregation operators.

Answered: 1 week ago