Given the following are definitions for the GymPackage, MenPackage and WomenPackage classes: Superclass {abstract}: GymP

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Given the following are definitions for the GymPackage, MenPackage and WomenPackage classes: Superclass {abstract}: GymP

Post by answerhappygod »

Given the following are definitions for the GymPackage,MenPackage and WomenPackage classes:
Superclass {abstract}: GymPackage
Attributes:
private int code; //customer code
private double deposit; //amount of deposit given bythe user
private char type; //package type for men orwomen
Methods:
public GymPackage (...) {...} //sets alldata
public int getCode() {...}
public double getDeposit() {...}
public abstract double paymentBalance();
Subclass :MenPackage
Attributes:
private int day; //number of days per week
Methods:
public MenPackage (...){...} //sets all data
public double paymentBalance() {...}
//retrievers
Subclass :WomenPackage
Attributes:
private boolean slimming; //true if the customerapply for extra
//slimming activities
public WomenPackage (...){...} //sets all data
public double paymentBalance() {...}
//retrievers
The rate and formula to calculatepayment for men package are as follows:
Type
Rate (RM) per day
A – Health
5
B – Body Builder
10
payment = (rate * day) -deposit
The rate and formula to calculatepayment for women package are as follows:
Type
Rate (RM)
A – Gym Equipment
80
B – Aerobic
120
C - Dancing
150
An extra RM70 is charged if customersapply for extra slimming activities
payment = rate – deposit +extra charge
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply