Question: C + + PROGRAM On your menu you will now have a Quit option. Instead of having to re - run the program to be
C PROGRAM
On your menu you will now have a "Quit" option. Instead of having to rerun the program to be able to enter information for each of the three events, the user will now be able to continuously enter information based on the event that heshe selects. The points that are assigned based on the rankings of each event should now be
accumulated to represent all points earned. instead of providing a ranking for each of the events, you will now provide an overall competition ranking based on the accumulated points. If the user chooses to not enter information for one, ore more, of the events, then there should not be any points assigned to that event. Your output should display each of the competitors listed from st place to last place, their"winning" status seconds weights, counts used in the competitions and the number of points that heshe earned overall. Lastly, you should now have appropriate input validation to where if the user enters an incorrect value for an input that heshe reenters the information. The program should not longer end if invalid input is entered.
#include
#include
#include
using namespace std;
int main
string competitor competitor competitor;
cout "Enter the name of the first competitor: ;
getline cin competitor;
cout "Enter the name of the second competitor: ;
getlinecin competitor;
cout "Enter the name of the third competitor: ;
getlinecin competitor;
int choice;
cout "Select the event:
;
cout Stone Over
;
cout Farmers Frame Medley
;
cout Axle Deadlift
;
cin choice;
if choice choice
cout "Invalid choice. Program will terminate.
;
return ;
double cattempt cattempt cattempt cattempt cattempt cattempt;
double cbest, cbest, cbest;
std::string firstPlace, secondPlace thirdPlace;
int firstPoints secondPoints thirdPoints ;
switch choice
case :
cout "You have selected Stone Over.
;
Input attempts for each competitor
cout "Enter two attempts for competitor: ;
cin cattempt cattempt;
cout "Enter two attempts for competitor: ;
cin cattempt cattempt;
cout "Enter two attempts for competitor: ;
cin cattempt cattempt;
Determine the best attempt
if cattempt cattempt
cbest cattempt;
else
cbest cattempt;
if cattempt cattempt
cbest cattempt;
else
cbest cattempt;
if cattempt cattempt
cbest cattempt;
else
cbest cattempt;
Rank the competitors
if cbest cbest and cbest cbest
firstPlace competitor;
if cbest cbest
secondPlace competitor;
thirdPlace competitor;
else
secondPlace competitor;
thirdPlace competitor;
else if cbest cbest and cbest cbest
firstPlace competitor;
if cbest cbest
secondPlace competitor;
thirdPlace competitor;
else
secondPlace competitor;
thirdPlace competitor;
else
firstPlace competitor;
if cbest cbest
secondPlace competitor;
thirdPlace competitor;
else
secondPlace competitor;
thirdPlace competitor;
Display the results
cout "Event: Stone Over
;
cout st Place: firstPlace firstPoints points
;
cout nd Place: secondPlace secondPoints points
;
cout rd Place: thirdPlace thirdPoints points
;
break;
case :
Farmers Frame Medley
cout "You have selected Farmers Frame Medley.
;
Input time in seconds
cout "Enter two attempts for competitorin seconds: ;
cin cbest cattempt;
if cattempt cattempt
cbest cattempt;
else
c
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
