Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Software Engineering: write the program in JAVA or C++ The Billing system of a h

ID: 3887918 • Letter: S

Question

Software Engineering: write the program in JAVA or C++

The Billing system of a hospital

A very interesting issue in a hospital for design and implement is the billing system. Patients are coming in the hospital, meet the doctors, and make a therapy etc. At the end the patient pay the bill with all the expenses that he did in the hospital.

The goal:

We have to implement the billing system considering all the expenses that a patient had for all the days that he was in the hospital.

How the system works:

When a patient comes to the hospital, a doctor will provide the necessities for his therapy. A patient has an ID and the hospital charges him with pharmacy needs, the doctor’s fee, and the room charges. Finally the patient pay for all the expences.

Design concepts:

For the design needs you need to define the parts of the application and to create the necessary classes and their methods. You have to find their exactly classes and method that you will map later to code.

Classes:

1. Doctor: (inherited from class Person), with the additional data member to store the doctor’s specialty.

-Add : the methods to initialize, access, and manipulate the data members.

2. Bill: add the data members to store a patient’s ID and the hospital charges such as: pharmacy charges for medicine, the doctor’s fee and the room charges.

-Add : the methods to initialize, access, and manipulate the data members.

3. Patient: (inherited from class Person), with the additional data members to store the patint ID, age, date of birth , attending physisan namre, the admitted day in the hospital, the discharged date from the hospital.

-Add : the methods to initialize, access, and manipulate the data members.

4. Date: to store the date of birth, admit day, discharge date.

5. Main: You will set:

-Patient ID, Patient First Name, Patient Last Name

-Doctor first name, Doctor last name

-Doctor specialty

-the admission date, the discharge date

-the pharmacy charges, room rent, doctor fee

Print: the bill with all the previous items.

You can also make another design without the Date class by including the Date’s data into another class

What is asking for:

1. The UML case diagram and the class diagram.

2. The class diagram (with attributes and operations and possibly any new class that is needed) Hint: The class diagram should be very close to your implementation

3. make test programs for the base class.

4. the demo program have to provide the printing of a bill with all the items as are referred in the main class.

SW:

The Billing system of a hospital

A very interesting issue in a hospital for design and implement is the billing system. Patients are coming in the hospital, meet the doctors, and make a therapy etc. At the end the patient pay the bill with all the expenses that he did in the hospital.

The goal:

We have to implement the billing system considering all the expenses that a patient had for all the days that he was in the hospital.

How the system works:

When a patient comes to the hospital, a doctor will provide the necessities for his therapy. A patient has an ID and the hospital charges him with pharmacy needs, the doctor’s fee, and the room charges. Finally the patient pay for all the expences.

Design concepts:

For the design needs you need to define the parts of the application and to create the necessary classes and their methods. You have to find their exactly classes and method that you will map later to code.

Classes:

1. Doctor: (inherited from class Person), with the additional data member to store the doctor’s specialty.

-Add : the methods to initialize, access, and manipulate the data members.

2. Bill: add the data members to store a patient’s ID and the hospital charges such as: pharmacy charges for medicine, the doctor’s fee and the room charges.

-Add : the methods to initialize, access, and manipulate the data members.

3. Patient: (inherited from class Person), with the additional data members to store the patint ID, age, date of birth , attending physisan namre, the admitted day in the hospital, the discharged date from the hospital.

-Add : the methods to initialize, access, and manipulate the data members.

4. Date: to store the date of birth, admit day, discharge date.

5. Main: You will set:

-Patient ID, Patient First Name, Patient Last Name

-Doctor first name, Doctor last name

-Doctor specialty

-the admission date, the discharge date

-the pharmacy charges, room rent, doctor fee

Print: the bill with all the previous items.

You can also make another design without the Date class by including the Date’s data into another class

What is asking for:

1. The UML case diagram and the class diagram.

2. The class diagram (with attributes and operations and possibly any new class that is needed) Hint: The class diagram should be very close to your implementation

3. make test programs for the base class.

4. the demo program have to provide the printing of a bill with all the items as are referred in the main class.

Explanation / Answer

I have the solve problem please find nelow the code

//Person.java

/**

* person class

* @author yourname

*

*/

public class Person {

//first and last name

private String first_name;

private String last_name;

//constructor

public Person(String first_name, String last_name) {

super();

this.first_name = first_name;

this.last_name = last_name;

}

//accessors and mutators

public String getFirst_name() {

return first_name;

}

public void setFirst_name(String first_name) {

this.first_name = first_name;

}

public String getLast_name() {

return last_name;

}

public void setLast_name(String last_name) {

this.last_name = last_name;

}

@Override

public String toString() {

return "First Name : " + first_name + " Last Name : " + last_name;

}

}

//Patient.java

/**

*

*Patient class

*

*/

public class Patient extends Person{

private int patient_id;

//have bill and date object

private Bill bill;

private Date date;

public Patient(String first_name, String last_name,int id) {

super(first_name, last_name);

this.patient_id=id;

}

//accessors and mutators

public int getPatient_id() {

return patient_id;

}

public void setPatient_id(int patient_id) {

this.patient_id = patient_id;

}

public Bill getBill() {

return bill;

}

public void setBill(Bill bill) {

this.bill = bill;

}

public Date getDate() {

return date;

}

public void setDate(Date date) {

this.date = date;

}

@Override

public String toString() {

return super.toString()+" Patient ID : " + patient_id ;

}

}

//Doctor.java

/**

*

* Doctor class extending person

*

*/

public class Doctor extends Person{

private String specialty;

public Doctor(String first_name, String last_name,String specialty) {

super(first_name, last_name);

this.specialty = specialty;

}

public String getSpecialty() {

return specialty;

}

public void setSpecialty(String specialty) {

this.specialty = specialty;

}

@Override

public String toString() {

return super.toString()+" Specialty : " +specialty;

}

}

//Bill.java

/**

*

*Bill class

*

*/

public class Bill {

private double pharmacy_charges;

private double doctor_fee;

private double room_charges;

private Patient patient;

//constructor

public Bill(double pharmacy_charges, double doctor_fee, double room_charges) {

super();

this.pharmacy_charges = pharmacy_charges;

this.doctor_fee = doctor_fee;

this.room_charges = room_charges;

}

public Bill()

{

}

//accessors and mutators

public double getPharmacy_charges() {

return pharmacy_charges;

}

public void setPharmacy_charges(double pharmacy_charges) {

this.pharmacy_charges = pharmacy_charges;

}

public double getDoctor_fee() {

return doctor_fee;

}

public void setDoctor_fee(double doctor_fee) {

this.doctor_fee = doctor_fee;

}

public double getRoom_charges() {

return room_charges;

}

public void setRoom_charges(double room_charges) {

this.room_charges = room_charges;

}

@Override

public String toString() {

return "Hospital Charges Pharmacy Charges : " + pharmacy_charges

+ " Doctor Fee : " + doctor_fee + " Room Charges : " + room_charges;

}

}

//Date.java

/**

*

* Date class

*

*/

public class Date {

private String admission_date;

private String discharge_date;

//constructor

public Date(String admission_date, String discharge_date) {

super();

this.admission_date = admission_date;

this.discharge_date = discharge_date;

}

public Date(){}

//accessors and mutators

public String getAdmission_date() {

return admission_date;

}

public void setAdmission_date(String admission_date) {

this.admission_date = admission_date;

}

public String getDischarge_date() {

return discharge_date;

}

public void setDischarge_date(String discharge_date) {

this.discharge_date = discharge_date;

}

@Override

public String toString() {

return "Admission date : " + admission_date + " Discharge date : " + discharge_date ;

}

}

//Test class

//HospitalTest.java

/**

* Test class for hospital

*

*/

public class HospitalTest {

public static void main(String[] args) {

//doctor created with name and specialty

Doctor doc = new Doctor("Smith", "Dev", "cardiologist");

//patient created with name and id

Patient pat = new Patient("John", "kayle", 123);

//bill created

Bill bill = new Bill();

bill.setDoctor_fee(190.45);

bill.setPharmacy_charges(563);

bill.setRoom_charges(330);

//set the bill to patient

pat.setBill(bill);

//date object

Date date = new Date();

date.setAdmission_date("09/18/2017");

date.setDischarge_date("09/21/2017");

//set the date to patient

pat.setDate(date);

//printing the all info

System.out.println("Doctor Info "+doc);

System.out.println(" Patient Info "+pat);

System.out.println(" Bill Info "+pat.getBill());

System.out.println(pat.getDate());

}

}

//OUTPUT:

Please accept apologizethere is issue with chegg server cant able to upload pic will share once it fixed,

Doctor Info
First Name : Smith
Last Name : Dev
Specialty : cardiologist

Patient Info
First Name : John
Last Name : kayle
Patient ID : 123

Bill Info
Hospital Charges
Pharmacy Charges : 563.0
Doctor Fee : 190.45
Room Charges : 330.0
Admission date : 09/18/2017
Discharge date : 09/21/2017

//class diagram and uml diagram will also share

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote