Question
QUESTION 2 (30 MARKS) Given the following DriveThru and HomeVisit subclasses are inherited from Patient superclass. Attributes: string patientNumber; // patient I/C number string patientName;
QUESTION 2 (30 MARKS)
Given the following DriveThru and HomeVisit subclasses are inherited from Patient superclass.
Attributes:
string patientNumber; // patient I/C number
string patientName; // patient name
boolean member; // either patient are member or not member
string date; // date of Covid-19 screening test
: DriveThru
Attributes:
string driveThruType; // the patient must choose either fast or standard lane
final double fastLane = 250.00; // cost of screening using fast lane
final double standardLane = 150.00; // cost of screening using standard lane
: HomeVisit
Attributes:
boolean shahAlam;
boolean petaling;
boolean klang;
boolean subang;
final double shahAlam = 300.00; // total price for Shah Alam
final double petaling = 350.00; // total price for Petaling
final double klang = 330.00; // total price for Klang
final double subang = 340.00; // total price for Subang
Scenarios :
Suraya's Clinic Centre is offering two types of services of Covid-19 screening test, which are the drive
thru and home visit. Those patient who are the members of the clinic will be given a special discount
of 15%.
Write a complete program to calculate the total price should be paid by the patient depending on the
services. The program can capture the details of the patient and the services chosen by the patient
before calculate and display the total price
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