Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Given the following classes and inheritance hierarchy: Safari DaySafari NightSafari public abstract class Safari private String guestName; private String identificationNum; private Boolean isMalaysian; public Safari
Given the following classes and inheritance hierarchy: Safari DaySafari NightSafari public abstract class Safari private String guestName; private String identificationNum; private Boolean isMalaysian; public Safari (String name, String ID, Boolean malaysian) ... //method definition) // accessor/retriever methods for each data member public String toString() { //method definition //method to update the balance for the account public abstract double totalCharges(); } Note: 15% Discount will be given from the total charges if the guest is a Malaysian. c) Write a Java application class called SafariApp that uses the concept of polymorphism to perform the following tasks: i) Get input from the user regarding the number of data to be stored and information for each guest. ii) Calculate and display the total charges for all guest. Also, count number of guests for each category (DaySafari and Night Safari). iii) Display all guest details that choose fastlane package under Night Safari category. (9 marks) Given the following classes and inheritance hierarchy: Safari DaySafari NightSafari public abstract class Safari private String guestName; private String identificationNum; private Boolean isMalaysian; public Safari (String name, String ID, Boolean malaysian) ... //method definition) // accessor/retriever methods for each data member public String toString() { //method definition //method to update the balance for the account public abstract double totalCharges(); } Note: 15% Discount will be given from the total charges if the guest is a Malaysian. c) Write a Java application class called SafariApp that uses the concept of polymorphism to perform the following tasks: i) Get input from the user regarding the number of data to be stored and information for each guest. ii) Calculate and display the total charges for all guest. Also, count number of guests for each category (DaySafari and Night Safari). iii) Display all guest details that choose fastlane package under Night Safari category. (9 marks)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started