Pure Programmer
Blue Matrix


Cluster Map

Project: Football Passer Rating (NFL)

In US football quarterbacks are rated on their performance based on a specific formula that combines statistics such as number of passing yards, number of touchdowns and number of interceptions. In the NFL the professional football passer rating formula is:






where

ATT
Number of passing attempts
COMP
Number of completions
YDS
Passing yards
TD
Touchdown passes
INT
Interceptions

Source: [[Passer Rating]]

The program should prompt the user for the five input values above and print the passer rating to one decimal place.

See: [[NFL Player Statistics]] for actual statistics that you can test with.

Output
$ g++ -std=c++17 FootballPasserRating1.cpp -o FootballPasserRating1 -lfmt $ ./FootballPasserRating1 < ../../projects/FootballPasserRating1.in1 Number of attempts: Number of completions: Number of touchdown passes: Number of interceptions: Number of passing yards: Passer rating: 112.3 $ g++ -std=c++17 FootballPasserRating1.cpp -o FootballPasserRating1 -lfmt $ ./FootballPasserRating1 < ../../projects/FootballPasserRating1.in2 Number of attempts: Number of completions: Number of touchdown passes: Number of interceptions: Number of passing yards: Passer rating: 96.3

Solution