Question: 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,

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
Get step-by-step solutions from verified subject matter experts
