Question: Define a class Athelete which has attributes of type String Name, Team and Sport. Has an integer attribute Uniform number and a double attribute Salary.

Define a class Athelete which has attributes of type String Name, Team and Sport. Has an integer attribute Uniform number and a double attribute Salary. It has a no parameter constructor and a five attribute constructor. It also has getters and setters for all its attributes. It also has a method called Raise which takes a double parameter which represent a percentage. The method changes the athletes salary by giving him the percentage increase in salary.

Write a main program that declares two variables of type Athlete and allows the user to enter the values for each Athlete, once using the five variable constructor and once using the no variable constructor and the setters. Have the program display the athletes and their values and then prompt the user for a percentage raise amount for each athlete and prints out their new salaries.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!