Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CHARGES: KINDLY CODE IN JAVA AND COPY PASTE THE CODE Given the following Water Park and Amusement Park subclass are inherited from ThemePark superclass. Superclass

image text in transcribed

image text in transcribed

image text in transcribed

CHARGES:

image text in transcribed

KINDLY CODE IN JAVA AND COPY PASTE THE CODE

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 Waterpark Data member(s): private boolean fastastic; // either true or false private boolean wonderful; // either true or false to ride Methods: boolean getFastastic(); // 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();// return the category double calCharges ();// calculate the charges c) Write Java codes which uses the concept of polymorphism to: 1. Store data on various types of Theme Park into an array of object, customer. The number of data to be stored and information on each customer given by the user. II. Calculate and display the total amount of payment for each Water and Amusement Park. Display information for all waterpark customers who opted for Fastastic Package. (13 marks) elow 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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Describe Table Structures in RDMSs.

Answered: 1 week ago