Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

QUESTION: The assignment requires you to write Java programs to store and display the data of outpatients at KUPTM Specialist Hospital. To complete the assignment,

image text in transcribed
image text in transcribed
QUESTION: The assignment requires you to write Java programs to store and display the data of outpatients at KUPTM Specialist Hospital. To complete the assignment, you are required to do the following tasks: 1. Provide a definition of a class called OutPatient which contains the following attributes and behaviors: Attributes: a. Patient's identification number (IC/Passport No.) b. Patient's Name c. Patient's Age d. Address e. Doctor's name f. Treatment charges (Consultation fee + Medicine charges) - Note: You may add any relevant attributes. Behaviors: - Constructor without parameter - Normal constructor - A retriever for each data member - A mutator to change the object state - Method double calcTrea tmentChrgs is used to calculate the total treatment charges for a particular outpatient. The consultation fee is fixed. - A tostring () method that displays all information about the outpatient objects. 2. Next, in a driver class named DemooutPatient, perform the following tasks: a. Create an array of the out Patient object named patientobj with the size of 20. b. Call constructor without parameter and give initial values for the instance variables appropriately. Then, store them into the arrays. c. Ask user to enter the necessary data and change the current object states of outPatient to the data entered by the user. d. Display the following information: i. Display patient's IC, name, age, address, doctor's name and total treatment charges for ALL outpatients. ii. Display the outpatient's data based on the following category: Children ( 12 years old and below) Adult (1359 years old) Senior citizen ( 60 years old and above)

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

Sams Teach Yourself Beginning Databases In 24 Hours

Authors: Ryan Stephens, Ron Plew

1st Edition

067232492X, 978-0672324925

More Books

Students also viewed these Databases questions