Question
1. The most important and well-known position on an NFL team is the quarterback. He does more to influence the result of an NFL game
1. The most important and well-known position on an NFL team is the quarterback. He does more to influence the result of an NFL game than any other single player on the team. His position is so important that a rather complicated measure called the Quarterback Rating (QR) has been created to compare NFL quarterbacks. The rating is comprehensive; unfortunately, this statistic is rather cumbersome to calculate by hand.in a rather complicated fashion. For a quarterback actually, for ANY player who attempts a forward pass the rating is determined as follows: QR = 100*{[(COM/ATT*100 - 30)/20] +[(YD/ATT - 3)/4] +[(TD/ATT*100)/5] +[(1/4)*(9.5-(INT/ATT)*100)]} / 6 In this formula, COM = the number of passes completed, ATT = the number of passes attempted, YD = gross yards passing, TD = number of touchdowns thrown, and INT = number of interceptions thrown. NOTE: The maximum value that a quarterback can obtain in any of the terms in square brackets is 2.375, while the minimum value that a quarterback can obtain in any of the terms in square brackets is 0.000. Your mission is to create a Quarterback class that will automatically calculate this rating. The class should take the following data (to be entered by the user as you deem appropriate i.e., either in main or within the class itself): passes attempted, passes completed, gross yards passing, touchdowns, and interceptions. Based on these statistics, you will calculate the quarterback rating based on the formula above. You will also have to keep in mind the following constraints: 1. Obviously, the passes completed cannot exceed the number of passes attempted. 2. Similarly, the number of touchdowns thrown cannot exceed the number of passes completed. 3. Also, the number of interceptions thrown cannot exceed the number of passes attempted. 4. Since a pass that is attempted is either completed, falls incomplete, or is intercepted, the sum of passes completed and passes intercepted cannot be greater than the passes attempted. 5. Since the longest possible pass play is 99 yards, the total gross yards passing cannot exceed 99*(passes completed). 6. Technically, a pass can be completed for negative yards. However, this occurrence is not a common one. Therefore, given that the biggest loss on a completed pass play in NFL history that I can find was 20 yards, the total gross yards passing must be at least (- 20)*(passes completed). You may handle output however you wish, although QRs are usually shown with only one decimal place.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started