Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(C++ please help) File swim.txt 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

(C++ please help)

File swim.txt

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

image text in transcribed

image text in transcribed

3. At the Texas high school championship swim meet, there are preliminary heats conducted for arn 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 simmer 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 a swimmer's first and last name separated by a space but containing no other spaces, followed by a space, 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 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 o o o 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) print the lane number, in order 1-8, followed by a period and a space, 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, print the seed time of the swimmer as shown in the example on the next page Do not assign a lane to or print the name of any disqualified swimmers o o o o Print a blank line Then print the event and a space followed by CHAMPIONSHIP FINALS

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

C++ Database Development

Authors: Al Stevens

1st Edition

1558283579, 978-1558283572

More Books

Students also viewed these Databases questions

Question

1 . Television News channels importantance of our Life pattern ?

Answered: 1 week ago