Enter the Judge\'s name:[Jerry Seinfeld] What is the current year? [2010] Enter
ID: 3637603 • Letter: E
Question
Enter the Judge's name:[Jerry Seinfeld]What is the current year? [2010]
Enter the Diver's name: [Charles Brown]
ASU Diving Competition - 2010
Diving Scores for Charles Brown
Enter the score for dive 1: [9.85]
Enter the score for dive 2: [7]
Enter the score for dive 3: [6.521]
Scores Difficulty Dive Total
9.85 1.600 15.76
7.00 2.243 15.70
6.52 3.450 22.50
The Total Score is 53.958
The Average Score is 7.790
Thank you, Judge Jerry Seinfeld, for entering scores for Charles
Brown
Press any key to continue
Explanation / Answer
please rate - thanks
#include <iostream>
#include <cstring>
#include <iomanip>
using namespace std;
int main()
{string judge,diver;
int year,i;
double difficulty[]={1.6,2.243,3.45},dive[3],total=0,t,t2=0;
cout<<"Enter the Judge's name: ";
getline(cin,judge);
cout<<"What is the current year? ";
cin>>year;
cin.ignore(80,' ');
cout<<"Enter the Divers's name: ";
getline(cin,diver);
//cin.ignore(80,' ');
cout<<"ASU Diving Competition - "<<year<<endl;
cout<<"Diving Scores for "<<diver<<endl;
for(i=0;i<3;i++)
{cout<<"Enter the score for dive "<<i+1<<": ";
cin>>dive[i];
}
cout<<"Scores Difficulty Dive Total ";
for(i=0;i<3;i++)
{t=dive[i]*difficulty[i];
total+=dive[i];
t2+=t;
cout<<setprecision(2)<<fixed<<dive[i]<<" "<<
setprecision(3)<<difficulty[i]<<" "<<
setprecision(2)<<t<<endl;
}
cout<<"The Total score is "<<setprecision(3)<<fixed<<t2<<endl;
cout<<"The Average score is "<<setprecision(3)<<fixed<<total/3.<<endl;
cout<<"Thank you, Judge "<<judge<<", for entering scores for "<<diver<<endl;
system("pause");
return 0;
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.