Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
image text in transcribed
image text in transcribed
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 WaterPark 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) 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; Heither 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(); W return the identification card number boolean getMember 03 return the membership String toString(); return the details of objects abstract double calcharges I 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 getFastastic(); // return the surfing status boolean getWonderful();// return the riding status double calCharges 0:// calculate the charges String toString();// return the details of objects Subclass: class Amusement Park Data member(s): private String category; W category of the customers Methods: String getCategory (); // return the category double calcharges();// calculate the charges

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

Database Concepts

Authors: David M Kroenke, David J Auer

6th Edition

0132742926, 978-0132742924

More Books

Students also viewed these Databases questions