Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

What is American Polity and Governance ?

Answered: 1 week ago

Question

What is Constitution, Political System and Public Policy? In India

Answered: 1 week ago

Question

What is Environment and Ecology? Explain with examples

Answered: 1 week ago