Write a class named Patient that has member variables for first name, middle name, last name, phone number, name and phone number of emergency contact. The Patient class should have a constructor that accepts and argument for each member variable. The Patient class should also have accessor and mutator functions for each member variable.

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter11: More Object-oriented Programming Concepts
Section: Chapter Questions
Problem 15RQ
icon
Related questions
Question

 Write a class named Patient that has member variables for first name, middle name, last name, phone number, name and phone number of emergency contact. The Patient class should have a constructor that accepts and argument for each member variable. The Patient class should also have accessor and mutator functions for each member variable.

          Write a class named Procedure that has member variables for name of procedure, date of procedure, name of physician, and charges for the procedure. This Procedure class represents a medical procedure that is performed on a patient. The Procedure class should have a constructor that accepts an argument for each member variable. The Procedure class should also have accessor and mutator functions for each member variable.

          Then write a program that creates an instance of the Patient class initialized with sample data that is entered by the user.

          Then, create an instance of the Procedure class for each procedure that is being performed on the patient. There can be multiple procedures that can be performed on each patient. At the end of the data entry for a patient, display the patient’s information, information about the procedure/s and the total charges for the patient.

I am studying in java class. So I need to write the program by java. In the photos are how my professor show me created class Patient and Procedure .  Thanks 

public class Procedure {
String name0fProcedure;
String dayofProcedure;
String name0fPhysician;
String chargesForTheProcedure;
/**
* @param name0fProcedure
* @param day0fProcedure
* @param name0fPhysician
* @param chargesForTheProcedure
*/
public Procedure(String name0fProcedure, String day0fProcedure, String n
String chargesForTheProcedure) {
this.name0fProcedure = name0fProcedure;
this.day0fProcedure =
this.name0fPhysician = name0fPhysician;
this.chargesForTheProcedure = chargesForTheProcedure;
}
dayofProcedure;
public String getNameOfProcedure() {
return name0fProcedure;
}
public String getDayofProcedure() {
return dayofProcedure;
}
public String getName0fPhysician() {
return name0fPhysician;
}
public String getChargesForTheProcedure() {
return chargesForTheProcedure;
}
public void setName0fProcedure(String name0fProcedure) {
this.name0fProcedure = name0fProcedure;
}
public void setDayofProcedure(String day0fProcedure) {
this.davofProcedure = dav0fProcedure:
Transcribed Image Text:public class Procedure { String name0fProcedure; String dayofProcedure; String name0fPhysician; String chargesForTheProcedure; /** * @param name0fProcedure * @param day0fProcedure * @param name0fPhysician * @param chargesForTheProcedure */ public Procedure(String name0fProcedure, String day0fProcedure, String n String chargesForTheProcedure) { this.name0fProcedure = name0fProcedure; this.day0fProcedure = this.name0fPhysician = name0fPhysician; this.chargesForTheProcedure = chargesForTheProcedure; } dayofProcedure; public String getNameOfProcedure() { return name0fProcedure; } public String getDayofProcedure() { return dayofProcedure; } public String getName0fPhysician() { return name0fPhysician; } public String getChargesForTheProcedure() { return chargesForTheProcedure; } public void setName0fProcedure(String name0fProcedure) { this.name0fProcedure = name0fProcedure; } public void setDayofProcedure(String day0fProcedure) { this.davofProcedure = dav0fProcedure:
public class Patient {
String firstName;
String middleName;
String lastName;
String phoneNumber;
String emerContName;
String emerContPhoneNumber;
/**
* @param firstName
* @param middleName
* @param lastName
* @param phoneNumber
* @param emerContName
* @param emerContPhoneNumber
*/
public Patient (String firstName, String middleName, String lastName, Str
String emerContPhoneNumber) {
this.firstName = firstName;
this.middleName = middleName;
this. lastName = lastName;
this.phoneNumber = phoneNumber;
this.emerContName = emerContName;
this. emerContPhoneNumber = emerContPhoneNumber;
}
public String getFirstName () {
return firstName;
}
public String getMiddleName ( ) {
return middleName;
}
public String getLastName () {
return lastName;
}
public String getPhoneNumber() {
return phoneNumber;
}
Transcribed Image Text:public class Patient { String firstName; String middleName; String lastName; String phoneNumber; String emerContName; String emerContPhoneNumber; /** * @param firstName * @param middleName * @param lastName * @param phoneNumber * @param emerContName * @param emerContPhoneNumber */ public Patient (String firstName, String middleName, String lastName, Str String emerContPhoneNumber) { this.firstName = firstName; this.middleName = middleName; this. lastName = lastName; this.phoneNumber = phoneNumber; this.emerContName = emerContName; this. emerContPhoneNumber = emerContPhoneNumber; } public String getFirstName () { return firstName; } public String getMiddleName ( ) { return middleName; } public String getLastName () { return lastName; } public String getPhoneNumber() { return phoneNumber; }
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage