Question: CODE IN JAVA PLEASE AND PLEASE COPY PASTE THE ANSWER, DONT SCREENSHOT IT Question 1 Given the following Water Park and Amusement Park subclass are



CODE IN JAVA PLEASE
AND PLEASE COPY PASTE THE ANSWER, DONT SCREENSHOT IT
Question 1 Given the following Water Park and Amusement Park subclass are inherited from ThemePark superclass. Superclass : abstract class Theme Park Data member(s): protected String name; // customer's name protected String idNo; // customer's identification card number protected boolean member; // either member or not member of the park Methods: Theme Park (); Theme Park (String name, String idNo, boolean member); String getName(); // return the customer's name String getId(); // return the identification card number boolean getMember (); // return the membership String toString(); // return the details of objects abstract double calCharges(); // calculate the charges Subclass: class Water Park Data member(s): private boolean fastastic; // either true or false private boolean wonderful; // either true or false to ride Methods: boolean getFastastie();// return the surfing status boolean getWonderful ():// return the riding status double calCharges (:// calculate the charges string tostring() // return the details of objects Subclass: class Amusement Park Data member(s): private String category // category of the customers Methods: string getCategory 0:// return the category double calCharges (7/7 calculate the charges a) Write the normal constructors for both subclasses. (4 marks) b) Given the details of ticket charges in table 1 and table 2 for both Water and Amusement Parks below: Package Cost(RM) Fastastic 75.00 Wonderful 50.00 Table 1 Details of ticket charges for Water Park Category Cost(RM) Adult 40.00 Child/Senior Citizen 25.00 Table 2 Details of ticket charges for Amusement Park Write methods named calcharges () to calculate the charges of the activities for both Water Park and AmusementPark classes. The customers who are the members of the theme park will be given a special discount of 25% for every total charges. (8 marks)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
