Page 1 of 1

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

Posted: Tue Jul 05, 2022 10:34 am
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