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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 22:50, savagesquid4807
Before you enter an intersection on a green light make sure
Answers: 2
image
Computers and Technology, 22.06.2019 04:30, Lilabbychichi
Ryan is working on the layout of her web page. she needs to figure out where her header, navigation bar, text, and images should go. what technique can her?
Answers: 1
image
Computers and Technology, 22.06.2019 14:10, normarismendoza
Dean wants a quick way to look up staff members by their staff id. in cell q3, nest the existing vlookup function in an iferror function. if the vlookup function returns an error result, the text “invalid staff id” should be displayed by the formula. (hint: you can test that this formula is working by changing the value in cell q2 to 0, but remember to set the value of cell q2 back to 1036 when the testing is complete.)
Answers: 3
image
Computers and Technology, 22.06.2019 20:00, manyah6189
Amanda needs to create an informative print brochure for her local library’s fundraiser dinner. what critical detail must she have before she starts designing the brochure?
Answers: 1
You know the right answer?
At the Texas high school championship swim meet, there are preliminary heats conducted for an event...

Questions in other subjects:

Konu
Mathematics, 08.05.2021 02:20