Question: inheritance (Advanced Classes) 1. Define a class named FootballPlayer that has 4 attributes: firstName (a string), lastName (also a string), weight (in decimal pounds), and
inheritance (Advanced Classes) 1. Define a class named FootballPlayer that has 4 attributes: firstName (a string), lastName (also a string), weight (in decimal pounds), and uniform number (an integer). Then derive from this class two other classes: Quarterback and RunningBack. The Quarterback class will be the class that you defined in Homework 2. The RunningBack class should add the following attributes: attempts, yards, and touchdowns. Each class should have appropriate accessor functions. Test the program by enabling the user to enter data for a lineman (a generic FootballPlayer), a Quarterback, and a RunningBack, then display this information. EXTRA CREDIT!!! We did not cover the topic of nested classes. However, if you wish to do some research into the topic ... add a fifth component to FootballPlayer: height, which should be a type Dimension that we defined in class. Add it to the list of items that the user inputs and that are printed as output
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
