Answered step by step
Verified Expert Solution
Question
1 Approved Answer
public class Fitnesstrainer protected string name; protected int experience; protected boolean certified; //true - has trainer qualification // false - no qualification protected double basicsalary:
public class Fitnesstrainer protected string name; protected int experience; protected boolean certified; //true - has trainer qualification // false - no qualification protected double basicsalary: /ormal constructor //accessor methods //totxins, method public class Personaltrainer extends Fitnesstrainer private String workplace; //either gym or home private int hours work /umber of daily working hours /ormal constructor //accessor methods //tastring method public double calculate Incentive(); } public class GroupTrainer extends Fitness Trainer private String workscheduls; //either weekdays or weekend private String activity: //yoga, aerobics, zumba, etc 1ormal constructor //accessor methods 1/50string() method Font hos Select - Paragraph Styles Editing Voice b) Write an application program that perform the following tasks: i. Declare an array named personal to store personal trainers' information and another array named group to store group trainers' information where the number of arrays is determined by the user. ii. Read all attributes for both subclasses into array I iii. Calculate and display the incentive earned by each personal trainer whose workplace is at the gym
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started