Question: C++ Assignment Write a C++program that follows the following steps: INPUT 1. Prompt the user for the name of the first runner (type string variable)

C++ Assignment

C++ Assignment Write a C++program that follows the following steps: INPUT 1.

Prompt the user for the name of the first runner (type string

variable) 2. Prompt the user for runner 1's finishing time (type double

variable) 3. Prompt the user for the name of the second runner

(type string variable) 4. Prompt the user for runner 2's finishing time

Write a C++program that follows the following steps: INPUT 1. Prompt the user for the name of the first runner (type string variable) 2. Prompt the user for runner 1's finishing time (type double variable) 3. Prompt the user for the name of the second runner (type string variable) 4. Prompt the user for runner 2's finishing time (type double variable) 5. Prompt the user for the name of the third runner (type string variable) 6. Prompt the user for runner 3's finishing time (type double variable) PROCESS 7. First, check if any of the times entered for any of the runners is less than zero. If this is the case, an error message should be displayed and then the program should end (see below). 8. If none of the times are negative, then do the following: 8A. Determine which runner made first place. (store this information in a variable of type string) 8B. Determine which runner made second place (store this information in a variable of type string) 8C. Determine which runner made third (last) place (store this information in a variable of type string) OUTPUT 9. If any of the times entered for any of the runners are negative, then display the error message. 10. Otherwise display the following 10A. Display which runner made first place 10B. Display which runner made second place 10C. Display which runner made third (last) place Sample Runs: The sample runs below will show you how your program should run for various inputs. The idea is that if you run your program with my inputs shown below, the output of your program should be the same as my output. This is how you can test your program to confirm that it is correct, but you are also encouraged to come up with your own additional test cases to further test your program. Sample Run 1: GADVC COMSC material de material Programming Solutions Chapter Opel-16. Enter the names of three runners and their finishing times. I will tell you who came in first, second, and third, Name of Runner 1: Peter Parker Runner 1's finishing time: 15 Name of Runner 2: Bruce Wayne Runner 2's finishing time: 10 Name of Runner 3: Clark Kent Runner 3's finishing time: 12 Bruce Wayne came in 1st place. Clark Kent came in 2nd place. Peter Parker came in 3rd place. Sample Run 2: GADVC COMSC material Gaddi tha material Programming Solution Chapter 1 pc-16. Enter the names of three runners and their finishing times. I will tell you who came in first, second, and third. Name of Runner 1: Luke Skywalker Runner l's finishing time: 25 Name of Runner 2: Obi-Wan Kenobi Runner 2's finishing time: 30 Name of Runner 3: Han Solo Runner 3's finishing time: 20 Han Solo came in 1st place. Luke Skywalker came in 2nd place. Obi-Wan Kenobi came in 3rd place Sample Run 3: C.COM Enter the names of three runners and their finishing times. I will tell you who came in first, second, and third. Name of Runner 1: Chewbacca Runner l's finishing time: 5 Name of Runner 2: R2-D2 Runner 2's finishing time: 7 Name of Runner 3: C-3PO Runner 3's finishing time: 9 Chewbacca came in 1st place. R2-D2 came in 2nd place. C-3PO came in 3rd place. N Sample Run 4: OVCOMSC .Besides that ma g ing Solution Chapter tapetes Enter the names of three runners and their finishing times. I will tell you who came in first, second, and third. Name of Runner 1: Darth Vader Runner l's finishing time: -1 Name of Runner 2: Boba Fett Runner 2's finishing time: 30 Name of Runner 3: Emperor Palpatine Runner 3's finishing time: 33 Enter positive values only for each runner's time

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!