Home / Expert Answers / Computer Science / q1-based-on-the-following-uml-class-diagram-write-a-java-program-using-textpad-that-implements-pa217

(Solved): Q1: Based on the following UML class diagram, write a Java program (using TextPad) that implements ...




Q1: Based on the following UML class diagram, write a Java program (using TextPad) that
implements the classes knowing that:
Q1: Based on the following UML class diagram, write a Java program (using TextPad) that implements the classes knowing that: Club visitorName: String +Club() Club String) toString(): String Members Guests -fees: double -pricePerHour: double hour: int participation: char Members) Quests() Membersichar, String) Guest(String, double, in setters and getters setters and getters findCost) double +toString(): String findCost(): double +toString Sering ?setters and getters are declared and used for the private data field only. o participation initial value is weekly "W' o fees initial value is 15JD o hour initial value is 1 o pricePerHour initial value is SJD o FindCost() in Members class ? returns the fees o findCost() in Guests class ? return the pricePerHours * hours otoString() in all classes returns values of all class data fields. o Create three objects (using the no-args constructor), one of each class and print their information. o Change participation value of the Members class created object to be monthly 'M' and change fees accordingly to be 50JD and print its cost. o Create an object of Guests class, type with values of your choice, and print its cost and its information. • Create a testing class with a main method to:


We have an Answer from Expert

View Expert Answer

Expert Answer


public class CheggClubDriver { public static void main(String[] args) { // TODO Auto-generated method stub Club C=new Club(); C.setVisitorName("Jason"); System.out.println(C.toString()); Members M=new Members(); M.setFees(50); M.setParticipation('M')
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe