Answered step by step
Verified Expert Solution
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
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