Question: Create an Athlete class. The athlete class must include the following: 1. The Athlete class a. is an abstract class with a single constructor, Athlete

Create an Athlete class. The athlete class must include the following:

Create an Athlete class. The athlete class must include the following: 1.

1. The Athlete class a. is an abstract class with a single constructor, Athlete (String Name , String fName, nt birthYear, int birthMonth, int birthDay) All arguments in the constructor should be stored as class fields. There should only be getter methods fr first and last names. There should be no getters or setters for the other fields listed in the constructors b. Getter and setter methods for the gender of the athlete stored as a char, the Professional status as a boolean. i. the method getISAPro which returns true if the athlete plays professionally, false is the athlete is amateur. The setIsAPro takes a boolean parameter, true if the athlete is a professional, false if the athlete is an amateur. ii. The method getGender return either the word "male" or "female" or "undeclared". The method setGender accepts 'm, 'M,f' or 'F which denotes male or female. Any other char will be treated as undeclared. c. The method computeAge takes no arguments and returns the athletes computed age as of today's date as a string of the form "X years, Y months and Z days". e.g. "21 years, 2 months and 3 days". Hint: Use the LocalDate and Period classes. d. The tostring method returns a string comprised of the results of getFname, getLName, getIsAPro and computeAge . .g e. The equals method returns true if the name and date of birth of this athlete and the compared other athlete are the same, otherwise return false

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!