Answered step by step
Verified Expert Solution
Question
1 Approved Answer
#include #include #include using namespace std; int main ( ) { / / Ask for the names of the competitors string names [ 3 ]
#include
#include
#include
using namespace std;
int main
Ask for the names of the competitors
string names;
for int i ; i ; i
cout "Enter the name of competitor i: ;
getlinecin namesi;
Display menu and get user's choice
int choice;
cout
Choose an event to enter results for:
;
cout Farmers frame medley
;
cout Axle deadlift
;
cout Stone over bar
;
cout "Enter to quit.
;
cout "Choice: ;
cin choice;
Process the user's choice
switch choice
case :
cout "Exiting program...
;
return ;
case :
Farmers frame medley
double times;
for int i ; i ; i
cout "Enter the time in seconds for namesi: ;
cin timesi;
if timesi
cout "Invalid input, exiting program...
;
return ;
Determine rankings and points
int ranks;
if times times swapranks ranks;
if times times
if times times swapranks ranks;
else swapranks ranks;
int points;
Display results
cout
Farmers frame medley results:
;
for int i ; i ; i
int idx ranksi;
cout setw namesidx completed in fixed setprecision timesidx seconds. ;
if i cout st place, pointsidx points.
;
else if i cout nd place, pointsidx points.
;
else cout rd place, pointsidx points.
;
break;
case :
Axle deadlift
double weights;
for int i ; i ; i
cout "Enter the weight in pounds lifted by namesi: ;
cin weightsi;
if weightsi
cout "Invalid input, exiting program...
;
return ;
Determine rankings and points
int ranks;
if weights weights swapranks ranks;
if weights weights
if weights weights swapranks ranks;
else swapranks ranks;
int NEEDS TO BE C WITH NO LOOPS OR VOIDS JUST A BASIC C CODE WITH LOTS OF COPY AND PASTE NO FUNCTIONS, IF ELSE AND CASES ONLY.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started