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 00:20
What’s resistance in an electrical circuit ?
Answers: 1
question
Computers and Technology, 22.06.2019 03:30
Some of your friends have gotten into the burgeoning field of time-series data mining, in which one looks for patterns in sequences of events that occur over time. purchases at stock exchanges--what’s being bought-- are one source of data with a natural ordering in time. given a long sequence s of such events, your friends want an efficient way to detect certain "patterns" in them--for example, they may want to know if the four events buy yahoo, buy ebay, buy yahoo, buy oracle occur in this sequence s, in order but not necessarily consecutively. they begin with a collection of possible events (e.g., the possible’ transactions) and a sequence s of n of these events. a given event may occur multiple times in s (e.g., yahoo stock may be bought many times in a single sequence s). we will say that a sequence s’ is a subsequence of s if there is a way to delete certain of the events from s so that the remaining events, in order, are equal to the sequence s’. so, for example, the sequence of four events above is a subsequence of the sequence buy amazon, buy yahoo, buy ebay, buy yahoo, buy yahoo, buy oracle their goal is to be able to dream up short sequences and quickly detect whether they are subsequences of s. so this is the problem they pose to you: give an algorithm that takes two sequences of even~s--s’ of length m and s of length n, each possibly containing an event more than once--and decides in time o(m n) whether s’ is a subsequence of s
Answers: 2
question
Computers and Technology, 24.06.2019 07:20
Ingrid started speaking about her slide presentation. when she clicked to th"third slide, which had just a picture of an elephant, she forgot what she wassupposed to talk about. what could ingrid do to avoid this situation in thefuture? oa. print handouts for her audience.ob. add presenter's notes to each slide.oc. add a video to each slide.od. save her slide presentation to a flash drive
Answers: 2
question
Computers and Technology, 24.06.2019 15:50
Subscribe to j p g a m e t u b e on you tube ?
Answers: 2
You know the right answer?
At the Texas high school championship swim meet, there are preliminary heats conducted for an event...
Questions
question
Mathematics, 25.02.2022 05:40
question
Mathematics, 25.02.2022 05:40
question
Chemistry, 25.02.2022 05:40
Questions on the website: 13722362