1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
|
/*----------------------------------------------------*/
/* */
/* */
/* This program computes the Quaterback Rating */
/* */
#include <iostream>
#include <cmath>
#include<iomanip>
using namespace std;
int main()
{
int A, // A Completed Passes
B, // B Pass Attempts
C, // C Passing Yards
D, // D Touchdown Passes
E; // E Interceptions
double round W, // W Completion Ratio
X, // X Yards per pass
Y, // Y Touchdown Ratio
Z, // Z Interception Ratio
qbRATING,
num=0.06;
cout<<"Please input the following data seperated by a space in the following\n"
"order (Completed Passes, Pass Attempts, Passing Yards, Touchdown Passes and\n"
"Interceptions):\n";
cin>>A>>B>>C>>D>>E;
//Calculate out the completion ratio, yards per pass, touchdown ation and the
//interception ratio
W = ((A/B)*100 - 30)/20;
X = ((C/B)-3.00)/4.00;
Y = ((D/B)*100)/5.00;
Z = (9.50 - (E/B) * 100)/4.00;
qbRATING = (W + X + Y + Z) / 0.06;
cout<<" The players stats as follows:\n";
cout<<" Completion Ratio:"<< W <<endl;
cout<<" Yards Per Pass:"<< X <<endl;
cout<<" Touchdown Ratio:"<< Y <<endl;
cout<<" Interception Ratio:"<< Z <<endl;
cout<<"\n\nThe quaterback rating is:"<<qbRATING<<endl;
system("PAUSE");
// Exit program.
return 0;
}
/*----------------------------------------------------*/
|