Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Emphasis on: structs or classes, arrays of structs or classes, sorting You are to read a series of 24-hour time values (hrs and mins only

Emphasis on: structs or classes, arrays of structs or classes, sorting You are to read a series of 24-hour time values (hrs and mins only no secs needed). Use either a struct or go ahead and use the class to represent the time. . Processing (these operations dont necessarily have to be done in this order): 1) Read in the times from the file times.txt and store them in an array (read hours and minutes in integer format and use the SetTime function to store into an array of structs or classes. 2) Modify each time by adding to it a random number of minutes (0-100 minutes) also read from the file. You will probably want to write a function to add a parameter number of minutes to the times. 3) Sort the resulting times into ascending 24-hour clock order. You can use the bubble sort function from the Malik book. You will probably want to write a function to compare two times. You have an EqualTime function, but you probably need to write a greater than function. 4) Print the list of sorted times. You have a PrintTime function that you can use. Input: read from text file times.txt Format: col 1 5 a time in 24-hour-clock format, like this hh:mm 7 9 an integer number of minutes to be added to the time

time.txt

6:45 39

12:00 73

0:00 4

23:59 1

22:45 70

11:59 1

14:15 95

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

Oracle 10g SQL

Authors: Joan Casteel, Lannes Morris Murphy

1st Edition

141883629X, 9781418836290

More Books

Students also viewed these Databases questions