Question: Would you please write a code to ask for three runners names first, second their finishing time, and third show results who take the first
Would you please write a code to ask for three runners names first, second their finishing time, and third show results who take the first second and third place based on the instruction provided below . thanks.
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 1s 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 2s 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 3s 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 m
ade 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 variab
le 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 co
nfirm 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:
Sample Run 2:
Sample Run 3:
Sample Run 4:
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
