/*Football Plays Author:Raymond Le Grand Description:After a long and grueling summer practice, Coach Weis is ready to get nasty and return Notre Dame to glory [1]. Before doing this however, he needs to first address some of the criticisms of his play calling. To do this, Charlie has compiled a list of the types of plays (pass, run), the direction of the play calls (left, middle, right), and the amount of yards gained for each play into a single spreadsheet. Unfortunately, OIT mysteriously revoked the Excel license from his computer, and so he needs you to generate ASCII histograms of the play calls. Once he can examine the play calling visually, he can make the adjustments necessary to finally beat USC and BC [2]. */ //be sure to use round func and neg yardage goes to zero // % is 60 char wide #define WIDTH 60 #include #include #include using namespace std; void output(int num,int total); int main(){ string word; int left=0,right=0,middle=0; int total=0,run=0,pass=0; float num; int yard[10]; for (int i=0;i<10;i++) yard[i]=0; while(true){ cin>>word; if (cin.eof()) break; total++; if (word=="Run,"){ run++; }else{ pass++; } cin>>word; if (word=="Left,"){ left++; }else if(word=="Right,"){ right++; }else{ middle++; } cin>>num; if (num<0.0) num=0.0; //record yardage yard[(int)floor(num/10.0)]++; } //output cout<<"Play Type:"<