Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

public abstract class ThemePark String name; 7/ customer's name String icNo; // customer's identification card number boolean member; // either member or nonmember of the

image text in transcribed

image text in transcribed

image text in transcribed

public abstract class ThemePark String name; 7/ customer's name String icNo; // customer's identification card number boolean member; // either member or nonmember of the // theme park //Methods: \/default and normal constructor //accessors //toString() public abstract double calCharges ()://calculate the charges public class Water Park extends Theme Park String activity; // surfBeach, waterRide or other //Methods: // default and normal constructor 7/accessors 11/toString() public double calCharges (.....) public class qildlife Park extends Theme Park String category:child or adult bocie ani 12 Inain: use train 29 not vide=au17 and normal constructor acce33043 logorang public double sa ichazges (!) The details of ticket charges are given in Table 5.1 and Table 5.2: Table 5.1 Details of ticket charges for Water Park Activity Cost (RM) Surf Beach 40.00 Water Rides 30.00 Other 15.00 Table 5.2 Details of ticket charges for Wildlife Park Category Cost (RM) 35.00 Child 20.00 An extra RM5 will be charged if the customer uses the train for Wildlife Park. 19 marks) b) Write code fragments in the application / driver class that can perform the following tasks: (Assume all relevant methods have been defined in all dasses involved) 1) Declare an array of object named tp to store various types of theme park where the size of array is entered by the user. (2 marks) ii) Assuming data has been stored in this tp array: calculate and display the total charges of every Water Park and WildlifePark ticket respectively. (5 marks) iii) Print the list of adult customers in the wildlife park and the total number of adults. followed by the list of child customers in the wildlife park and the total number of children. (8 marks)

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

Step: 3

blur-text-image

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

Pro Oracle Fusion Applications Installation And Administration

Authors: Tushar Thakker

1st Edition

1484209834, 9781484209837

More Books

Students also viewed these Databases questions

Question

Which year had the best March sales?

Answered: 1 week ago