A. Write a Java Program that includes the following details  You are tasked to develop a program to implement a simple Hospital Information System that will provide information about Hospitals such as their Doctors and Patient.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

A. Write a Java Program that includes the following details 
You are tasked to develop a program to implement a simple Hospital Information System that will
provide information about Hospitals such as their Doctors and Patient.

 

1. Create a Hospital class and do the following:
a) Declare the following member variables: Hospital Id, and Hospital Name
b) Create a default constructor with no parameter.
c) Create a parameterized constructor to initialize all the member variables.
d) Create a method to display all the member variables.

 

2. Create a class Doctor and do the following:
a) The class should inherit the Hospital Class.
b) Declare a member variable Doctor id and Doctor salary.
c) Create a default constructor with no parameter
d) Create a parameterized constructor that will call the constructor of the parent class (super
class) and then initialize the member variables.
e) Create a method that will return a value to calculate the Doctor Salary by the Doctor using the
formula below:
Total Salary = Doctor Salary – (0.2 * Doctor Salary)
f) Create an overriding method to display all the member variables. The method should
invoke/call the super class display method and then display also all the member variables of
this class.

3. Create a class Patient and do the following:
a) The class should inherit the Hospital Class.
b) Declare a member variable Patient status and number of days
c) Create a default constructor with no parameter
d) Create a parameterized constructor that will call the constructor of the parent class (super
class) and then initialize the member variables.
e) Create a method that will return a value to determine the status of the patient based on the
criteria below:
When Patient status is equal to “in” and number of days is greater than or equal to 5
then the status of the patient is “Not good”.
Otherwise, the status of the patient is “OK”
The method should return the status of the patient.
f) Create an overriding method to display all the member variables. The method should
invoke/call the super class display method and then display also all the member variables of
this class.

 


4. Create a controlling class and do the following:
* Create an object for the two (2) subclasses
* Read the input, call the necessary methods, and display the required output as shown below.

Sample Input / Output
run:
Input Hospital Name:
Input Hospital Id:
Al-RAFA
123
Input Doctor id:
Input Doctor Salary:
101
1500.0
Hospital Id =123
Name = Al-RAFA
Doctor Details with Salary
Doctor
id
101
Doctor Salary =
1500.0
The Total
Salary is
1200.0
Input Patient
Staus:
IN
Input Number of
Days:
6.
Hospital Id -123
Name - Al-RAFA
Patient Details with Satus
Patient Status
IN
%3D
Number of days =
6.0
Status of
Patient
is Not good
BUILD SUCCESSFUL
(total
time:
7 minutes
O seconds)
Transcribed Image Text:Sample Input / Output run: Input Hospital Name: Input Hospital Id: Al-RAFA 123 Input Doctor id: Input Doctor Salary: 101 1500.0 Hospital Id =123 Name = Al-RAFA Doctor Details with Salary Doctor id 101 Doctor Salary = 1500.0 The Total Salary is 1200.0 Input Patient Staus: IN Input Number of Days: 6. Hospital Id -123 Name - Al-RAFA Patient Details with Satus Patient Status IN %3D Number of days = 6.0 Status of Patient is Not good BUILD SUCCESSFUL (total time: 7 minutes O seconds)
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps with 1 images

Blurred answer
Knowledge Booster
Data members
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education