Patient Charges
Write a class named Patient that has member variables for the following data:
• First name, middle name, last name
• Address, city, state, and ZIP code
• Phone number
• Name and phone number of emergency contact
The Patient class should have a constructor that accepts an argument for each member variable. The Patient class should also have accessor and mutator functions for each member variable.
Next, write a class named Procedure that represents a medical procedure that has been performed on a patient. The Procedure class should have member variables for the following data:
• Name of the procedure
• Date of the procedure
• Name of the practitioner who performed the procedure
• Charges for the procedure
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.
Next, write a program that creates an instance of the Patient class, initialized with sample data. Then, create three instances of the Procedure class, initialized with the following data:
Procedure #1: | Procedure #2: | Procedure #3: |
Procedure name: Physical Exam | Procedure name: X-ray | Procedure name: Blood test |
Date: Today’s date | Date: Today’s date | Date: Today’s date |
Practitioner: Dr. Irvine | Practitioner: Dr. Jamison | Practitioner: Dr. Smith |
Charge: 250.00 | Charge: 500.00 | Charge: 200.00 |
The program should display the patient’s information, information about all three of the procedures, and the total charges of the three procedures.
Want to see the full answer?
Check out a sample textbook solutionChapter 13 Solutions
EBK STARTING OUT WITH C++ FROM CONTROL
Additional Engineering Textbook Solutions
Starting Out with C++ from Control Structures to Objects (8th Edition)
Software Engineering (10th Edition)
Concepts Of Programming Languages
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
Java: An Introduction to Problem Solving and Programming (8th Edition)
Starting Out with C++: Early Objects (9th Edition)
- True or FalseA base class reference variable can reference an object of any class that is derived from the base class.arrow_forward2. Car Class Write a class named Car that has the following data attributes: _ _year_model (for the car’s year model) _ _make (for the make of the car) _ _speed (for the car’s current speed) The Car class should have an _ _init_ _ method that accepts the car’s year model and make as arguments. These values should be assigned to the object’s _ _year_model and _ _make data attributes. It should also assign 0 to the _ _speed data attribute. The class should also have the following methods: accelerate The accelerate method should add 5 to the speed data attribute each time it is called. brake The brake method should subtract 5 from the speed data attribute each time it is called. get_speed The get_speed method should return the current speed. Next, design a program that creates a Car object then calls the accelerate method five times. After each call to the accelerate method, get the current speed of the car and display it. Then call the brake method five times. After…arrow_forward2. Car Class Write a class named Car that has the following data attributes: _ _year_model (for the car’s year model) _ _make (for the make of the car) _ _speed (for the car’s current speed) The Car class should have an _ _init_ _ method that accepts the car’s year model and make as arguments. These values should be assigned to the object’s _ _year_model and _ _make data attributes. It should also assign 0 to the _ _speed data attribute. The class should also have the following methods: accelerate The accelerate method should add 5 to the speed data attribute each time it is called. brake The brake method should subtract 5 from the speed data attribute each time it is called. get_speed The get_speed method should return the current speed. Next, design a program that creates a Car object then calls the accelerate method five times. After each call to the accelerate method, get the current speed of the car and display it. Then call the brake method five times. After each call to the…arrow_forward
- T/F A method defined in a class can access the class' instance data without needing to pass them as parameters or declare them as local variables.arrow_forwardProblem: Employee and ProductionWorker Classes Write a python class named ProductionWorker that is a subclass of the Employee class. The ProductionWorker class should keep data attributes for the following information: • Shift number (an integer, such as 1, 2, or 3)• Hourly pay rateThe workday is divided into two shifts: day and night. The shift attribute will hold an integer value representing the shift that the employee works. The day shift is shift 1 and the night shift is shift 2. Write the appropriate accessor and mutator methods for this class. Once you have written the class, write a program that creates an object of the ProductionWorker class, and prompts the user to enter data for each of the object’s data attributes. Store the data in the object, then use the object’s accessor methods to retrieve it and display it on the screen Note: The program should be written in python. Sample Input/Output: Enter the name: Ahmed Al-AliEnter the ID number: 12345Enter the department:…arrow_forwardCruise Recreational Activities Example Recreational activities include things like aerobics, shuffle board, and swimming. Each activity is identified by an activity code and includes other information such as description. Classes are offered for each activity. A class is uniquely identified by a combination of the activity code and the day/time at which it is held. It is assumed that a specific class will never be offered for the same activity at the same day and time, although it could be offered on a different day and/or time. Other information about a class includes the enrollment limit and the current enrollment count. A class will never include more than one activity. A passenger can sign up for a class as long as there is sufficient room in the class. Passengers are identified by a unique passenger number. Other information stored about passengers includes name, address, and age. Passengers have no limit on the number and type of classes they can sign up for. When they…arrow_forward
- We use the _____ operator to create an instance of (object in) a particular class.arrow_forwardC++ oop using classes only You are going to make an employee management system. In this lab, you have to create anEmployee class only. Employee class fields are: Employee Name, Employee ID, andEmployee Gender. The member functions include the getters and setters for all the membervariables and display () function to display the data. In the main function, first create twoEmployee objects and allow the user to enter data in these objects. Secondly, display thedata from these objects.arrow_forwardEmployee and ProductionWorker Classes Create an Employee class that has properties for the following data: Employee name Employee number Next, create a class named ProductionWorker that is derived from the Employee class. The ProductionWorker class should have properties to hold the following data: Shift number (an integer, such as 1, 2, or 3) Hourly pay rate The workday is divided into two shifts: day and night. The Shift property will hold an integer value representing the shift that the employee works. The day shift is shift 1 and the night shift is shift 2. Create an application that creates an object of the ProductionWorker class and lets the user enter data for each of the object’s properties. Retrieve the object’s properties and display their values.arrow_forward
- True or False: 1. Data items in a class may be public. 2. Class members are public by default. 3. Friend functions have access only to public members of the class.arrow_forwardThere are two types of data members in a class: static and non-static. Provide an example of when it might be useful to have a static data member in the actual world.arrow_forwardIn order to extend a class, the new class should have access to all the data and inner workings of the parent class. True Falsearrow_forward
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT