Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need help writing a program that calculates the NFL quarterback passer rating.

ID: 3629349 • Letter: I

Question

I need help writing a program that calculates the NFL quarterback passer rating. Have the user enter from the keyboard the 5 inputs as integers and outputs the passer rating. Assume all values entered are valid. Format the output to one decimal place.
http://football.stassen.com/cgi-bin/calc-pe.pl?a=283&c=173&y=2877&t=22&i=5

Explanation / Answer

#include int main() { int attempts, yards, completions, touchdowns, interceptions; std::cout > attempts; std::cout > completions; std::cout > yards; std::cout > touchdowns; std::cout > interceptions; double rating = ((100 * completions / (double)attempts) - 30.0) * 0.05 + ((yards / (double)attempts) - 3.0) * 0.25 + 20 * touchdowns / (double)attempts + 2.375 - (25 * interceptions / (double)attempts); printf("Rating is %.1f ", rating); }