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 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126
|
#include <iostream>
using namespace std;
int main()
{
string player[50];
float uPER, MP, threeP, AST, factor, teamAST, teamFG, FG, FT, VOP, TOV, DRB, FGA, FTA, TRB, ORB, STL, BLK, PF, lgFT, lgPF, lgFTA, lgAST, lgFG, lgPTS, lgFGA, lgORB, lgTOV, lgTRB;
cout << "This program calculates NBA players PER, or Player Efficiency Rating." << endl;
cout << "Player's name? ";
cin >> player[50];
cout << "Enter " << player[50] << " per game stats when prompted." << endl;
cout << "Minutes Played: ";
cin >> MP;
cout << endl;
cout << "Three Pointers: ";
cin >> threeP;
cout << endl;
cout << "Assists: ";
cin >> AST;
cout << endl;
cout << "Team Assists: ";
cin >> teamAST;
cout << endl;
cout << "Team Field Goals: ";
cin >> teamFG;
cout << endl;
cout << "Field Goals: ";
cin >> FG;
cout << endl;
cout << "Free Throws: ";
cin >> FT;
cout << endl;
cout << "Turnovers: ";
cin >> TOV;
cout << endl;
cout << "Field Goals Attempted: ";
cin >> FGA;
cout << endl;
cout << "Free Throws Attempted: ";
cin >> FTA;
cout << endl;
cout << "Total Rebounds: ";
cin >> TRB;
cout << endl;
cout << "Offensive Rebounds: ";
cin >> ORB;
cout << endl;
cout << "Steals: ";
cin >> STL;
cout << endl;
cout << "BLocks: ";
cin >> BLK;
cout << endl;
cout << "Personal Fouls: ";
cin >> PF;
cout << endl;
cout << "League Average for the next stats.";
cout << endl;
cout << "Free Throws: ";
cin >> lgFT;
cout << endl;
cout << "Personal Fouls: ";
cin >> lgPF;
cout << endl;
cout << "Free Throws Attempted: ";
cin >> lgFTA;
cout << endl;
cout << "Assists: ";
cin >> lgAST;
cout << endl;
cout << "Field Goals: ";
cin >> lgFG;
cout << endl;
cout << "Points: ";
cin >> lgPTS;
cout << endl;
cout << "Field Goals Attempted: ";
cin >> lgFGA;
cout << endl;
cout << "Offensive Rebounds: ";
cin >> lgORB;
cout << endl;
cout << "Turnovers: ";
cin >> lgTOV;
cout << endl;
cout << "Total Rebounds: ";
cin >> lgTRB;
cout << endl;
factor = (2 / 3) - (0.5 * (lgAST / lgFG)) / (2 * (lgFG / lgFT));
VOP = lgPTS / (lgFGA - lgORB + lgTOV + 0.44 * lgFTA);
DRB = (lgTRB - lgORB) / lgTRB;
cout << factor << " , " << VOP << " , " << DRB;
}
|