Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You are given a task to store data of employee in a company in a form of BST. Data will be stored in a BST

You are given a task to store data of employee in a company in a form of BST. Data will be stored in a BST according to patients age. *Create your own hospital data. Write your data in a table.  Complete all the class given below  public class Hospital { } private String patientID, doctorName, patientName, private String patientCatgory; //inpatient outpatient private double treatmentCharge;private int age; //patient age private int day(); //day of inpatient stay in wardedprivate boolean warded; true if inpatient false if outpatient //constructor //accessor //mutator //toString method public class TreeNode { private Hospital data; private TreeNode left, right; //constructor //accessor } public class BSTHospital { TreeNode root; Hospital data; //method insert(Hospital data)  arrange object by using year id services as a key value } //method findInpatient() //all in-patient//method findOutpatient()//all out-patient//method totalCharge //total charges for all patient in hospital //method AverageCharge() //calculate the average charge //method AverageDay() //calculate the average day patient stay //method PrintascendingOrder()using inorder traversal Write a main class named MainBSTHospital. Your program should be able to read data from file hospital.txt and demonstrate the following menu: Add new patient  Display all in-patient  Display all out-patient  Display average total charge  Display average day patient stay in hospital  Display all patient in ascending order  *Display your output in tabulate format

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

Essential SQLAlchemy Mapping Python To Databases

Authors: Myers, Jason Myers

2nd Edition

1491916567, 9781491916568

More Books

Students also viewed these Databases questions