subject
Computers and Technology, 18.03.2021 01:20 knela

At the Texas high school championship swim meet, there are preliminary heats conducted for an event during the day to determine the 16 fastest swimmers in the meet who will swim in the championship finals and consolation finals at night. The fastest eight swimmers from the preliminary heats swim in the championship finals race and the next fastest eight swimmers swim in the consolation finals race. The remaining swimmers do not swim in the night events. In swimming, the lanes are numbered from 1 to 8 with lane 1 being on the far left and lane 8 being on the far right. The preferred lane numbers for a swimmer are in this order: 4, 5, 3, 6, 2, 7, 1, 8. By seeding the swimmers in this order, the fastest swimmers have the advantage of swimming in the smooth water in the middle of the pool and the slower swimmers must fight the wake of the faster swimmers by swimming in the outside lanes. Write a C++ program that will find the 16 fastest swimmers from the list of preliminary swimmers and print their lane assignments for the consolation finals and championship finals races. Input will be from a text file where the first line of input will contain a single integer n that indicates the number of events to be swum. For each event: • The first line will contain the name of the event. • The second line will contain a single integer m that indicates the number of swimmers in that event. • Each of the following m lines will contain: o a swimmer's first and last name separated by a space but containing no other spaces, followed by a space, o the swimmer's time in the preliminary heat in the form: mm:ss. hh where mm is the number of minutes, ss is the number of seconds, and hh is the number of hundredths of a second, but o if the swimmer's time is DQ, the swimmer was disqualified from the event and cannot swim in the consolation finals or championship finals events. Assume that there are at least 10 swimmers that will qualify for the night events and no two swimmers have the exact same time. For each event output: • Seed the swimmers into their preferred lanes based on the lane order above. • Then print the event and a space followed by CONSOLATION FINALS. • On each of the next 8 lines (or less if there are not enough swimmers): o Print the lane number, in order 1-8, followed by a period and a space, o Print the last name, a comma and a space followed by the first name of the swimmer assigned to that lane, and then another space, and finally, o Print the seed time of the swimmer as shown in the example on the next page. o Do not assign a lane to or print the name of any disqualified swimmers. • Print a blank line. • Then print the event and a space followed by CHAMPIONSHIP FINALS. • On each of the next 8 lines (or less if there are not enough swimmers): COSC 1437 F197 Print the lane number, in order 1-8, followed by a period and a space, o Print the last name, a comma and a space followed by the first name of the swimmer assigned to that lane, and then another space, and finally, o Print the seed time of the swimmer as shown in the example on the next page. • Print a blank line. A blank line is optional after the last data set. Let the user input the file name from the keyboard. Use any appropriate sort as needed. Use the C++ string class. Refer to the sample output below. Sample File: 1 100 M FREESTYLE 18 JAMES SMITH 01:10.01 TOM JONES 01:20.00 HOWARD COSELL 01:19.30 DON MEREDITH 01:21.28 RON JONES 01:17.30 RICHARD LUCAS 01:09.30 RONNIE WERTH 01:11.38 JACK MOSES 01:19.94 DAN ROGERS 01:15.84 ROGER WILLIAMS 01:15.83 WILLIAM GEORGE 01:12.27 GEORGE JONES 01:13.45 MARK CHRISTIE 01:45.12 CHRIS LEOPARD 01:59.29 MAJOR APPLEWHITE DQ RICK CHARLES 01:12.67 CHARLES SHERMAN 01:13.22 SHERMAN WILLIS 01:17.78 Sample Run: Enter the file name: swim. txt 100 M FREESTYLE CONSOLATION FINALS 1 MEREDITH, DON 01:21.28 2 MOSES, JACK 01:19.94 3 WILLIS, SHERMAN 01:17.78 4 ROGERS, DAN 01:15.84 5 JONES, RON 01:17.30 6 COSELL, HOWARD 01:19.30 7 JONES, TOM 01:20.00 8 CHRISTIE, MARK 01:45.12 100 M FREESTYLE CHAMPIONSHIP FINALS COSC 1437 F198 1 JONES, GEORGE 01:13.45 2 CHARLES, RICK 01:12.67 3 WERTH, RONNIE 01:11.38 4 LUCAS, RICHARD 01:09.30 5 SMITH, JAMES 01:10.01 6 GEORGE, WILLIAM 01:12.27 7 SHERMAN, CHARLES 01:13.22 8 WILLIAMS, ROGER 01:15.83

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 10:50
A911 dispatcher is the sole sender of messages to all police officers. while on patrol, officers communicate with the dispatcher who, in turn, relays messages to other officers. the officers do not communicate directly with one another. this illustrates a network.
Answers: 1
question
Computers and Technology, 22.06.2019 20:00
Need asap assignment directions: think of an organization (business, religious institution, volunteer organization, sports team) with which you have been involved. imagine outfitting it with an it infrastructure. prepare a plan for what you would do to support outfitting it. draw a map of a network connecting all the individuals, give them pcs and printers, and lay out the design as best you can. the purpose is to begin working with these concepts, not to build a perfect network.
Answers: 2
question
Computers and Technology, 24.06.2019 07:40
What type of multimedia are live news feeds? live news feeds are examples of multimedia.
Answers: 2
question
Computers and Technology, 24.06.2019 10:10
Which view in a presentation program displays a split window showing the slide in the upper half and a blank space in the lower half?
Answers: 1
You know the right answer?
At the Texas high school championship swim meet, there are preliminary heats conducted for an event...
Questions
question
Social Studies, 24.04.2020 02:04
question
Mathematics, 24.04.2020 02:04
question
Biology, 24.04.2020 02:04
question
English, 24.04.2020 02:04
Questions on the website: 13722363