Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I also want to do the bonus please CS2010 Lab9 Overview: This lab assignment is designed to give you practice working with functions that pass

I also want to do the bonus please image text in transcribed
image text in transcribed
image text in transcribed
CS2010 Lab9 Overview: This lab assignment is designed to give you practice working with functions that pass argument(s) by value and by reference Your task as organizers of the upcoming one mile race is to determine whether runners qualify for entry given their age and best racing time from other one mile races. The data file lab9.txt contains a name, age and best mile time (in seconds) for each runner. Here is sample data for the first two runners: Mason 25 255 fstream Vot1n er In.open"ebtt 365 Complete each step below and make sure your code is working before going on to the next step Step A. Create a new C++ project and copy the data file. 1. Use your last name and lab9 for your project folder and cpp file names (e.g. JoynerJ lab9 and JoynerJ lab9.cpp). Include your name in a comment at the beginning of the cpp file. 2. Copy the file lab9.txt from Canvas (Files 03 Lab Assignments) to your project folder Step B. Write a main function to read in and display the data from the file. See ch05b_Gaddis File JO pdf for a review of the file operations. 1. Declare an input file variable and variables to hold the racer's name, age and time. 2. Open the file lab9.txt and check the success of the file operation. 3. Display a heading - see example below. 4. Read in the first name 5. While you are not at the end of the file: read in the age and time display the racer's name, age and time all on one line on the screen read in the next name - . - Mile Race Results Your name Name Mason Layman Age Tine (sec) 255 32 365 STOP-do not go on to the next step until you can correctly read in and display the data from the file. Step C.Add the function checkAgeTime In the data file it is assumed that the first number after a racers name is the age and the second number is the time. Unfortunately, because of a communication error some of the data was entered in the opposite order. The function checkAgeTime should figure out which data corresponds to each measure and switch the two numbers if necessary

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

Database And Expert Systems Applications 24th International Conference Dexa 2013 Prague Czech Republic August 2013 Proceedings Part 1 Lncs 8055

Authors: Hendrik Decker ,Lenka Lhotska ,Sebastian Link ,Josef Basl ,A Min Tjoa

2013 Edition

3642402844, 978-3642402845

More Books

Students also viewed these Databases questions