/* Passing Efficiency Calculator Write a C program that calculates passer rating for NCAA quarterbacks. The Inputs: Pass Attempts - ATT Pass Yards - YDS Completions - COMP Passing Touchdowns - TDS Interceptions - INTS The output is the passer rating, also called passing efficiency. All inputs should be whole numbers. The output should be truncated at 2 places after the decimal point. The following is the relevant equation: Passer Rating = ((8.4*YDS)+(330*TDS)+(100*COMP)-(200*INT))/ATT The formula calculation must be performed inside a function that return the passer rating to the main function, which prints it. The sample run below uses stats from ISU quarterback Steele Jantz' 2011 season. ============= START OF SAMPLE RUN ======================= Enter Pass Attempts: 259 Enter Passing Yards: 1519 Enter Touchdowns: 10 Enter Completions: 138 Enter Interceptions: 11 This quarterback has a passer rating of 106.79 ============= END OF SAMPLE RUN ======================= */ #include #include double getPasserRating(int att, int yds, int tds, int comp, int ints) { double rating; rating = 8.4*yds + 330*tds + 100*comp - 200*ints; rating = rating/att; return rating; } int main() { printf("Enter Pass Attempts: "); int att; scanf("%d", &att); printf("Enter Passing Yards: "); int yds; scanf("%d", &yds); printf("Enter Touchdowns: "); int tds; scanf("%d", &tds); printf("Enter Completions: "); int comp; scanf("%d", &comp); printf("Enter Interceptions: "); int ints; scanf("%d", &ints); double PasserRating; PasserRating = getPasserRating(att, yds, tds, comp, ints); printf("\nThis quarterback has a passer rating of %.2lf\n", PasserRating); system("pause"); return 0; }