Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

*Java Code* 1) Design an abstract class for Athlete a) Define at least 2 data members i) String SportType b) Write a constructor for the

*Java Code*image text in transcribed

1) Design an abstract class for Athlete a) Define at least 2 data members i) String SportType b) Write a constructor for the class that will accept initial values for the 2 data members c) Design a child class of the Athlete called Tennis i) String FullName Write a toString method i) Add a data member to store number of games won this season 2) ii) Add a constructor that accepts this the person's name and number of games won as parameters iii) Write a new toString that will first call the toString of the parent and then add on the new data member for the the number of games won 3) Design a child class of the Athlete called Baseball i) Add a data member to store batting average ii) Add a constructor that accepts this the person's name and batting average as parameters iii) Write a new toString that will first call the toString of the parent and then add on the new data member for the batting average 4) In main methood a) Make an object of Tennis and then output using the toString method b) Make an object of Baseball and then output using the toString method Sport: Bob Smith Name: Baseball Batting Average: 0.678 Sport: Sue Jones Name: Tennis Games won this season: 15

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

=+7 What is the overall cost of the international assignment?

Answered: 1 week ago