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++
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)
- 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_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_forwardWe use the _____ operator to create an instance of (object in) a particular class.arrow_forward
- There 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_forwardTrue 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_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
- C# languageWrite a program to create a class employee, it consist of ID, name, department and address. All employees belongs to “Computer Science” department and it can never be changed by any means. Employee ID is initialized only once when Employee object is created, any further attempt to change ID should be failed. Class must have a 3 parameterized constructor to set values and two methods: print(): to display all the data of a particular employee totalObjects(): to count and print total number of objects that has been created In Main(), create atleast two objects of employee class, display their records by calling print() function and also print the total number of objects that has been created. [this question is continued on next page] Sample Main Method: static void Main(string[] args) { Employee obj1 = new Employee(1, "Zubair", "Karachi"); obj1.print(); Employee obj2 = new Employee(2, "Nabeel", "Islamabad"); obj2.print();…arrow_forwardExercise 1-Account class • Design a class named Account that contains : • A private int data field named id for the account • A private double data field named balance for the account • A privet Date data field named dateCreated that stores the date when the account was created • A no-arg constructor that creates a default account • A constructor that creates an account with the specified id and initial balance • The getters (i.e., accessors) and setters (i.e., mutators) methods for id and balance • The getter method for dateCreated • A method named withdraw that withdraws a specified amount from the account • A method named deposit that deposits a specified amount to the accountarrow_forwardC++arrow_forward
- Dynamic Games Instructions: Write a class called Game that contains a video game’s name, genre, and difficultyLevel. Include a default constructor and destructor for the class. The constructor should print out the following message: “Creating a new game”. The destructor should print out the following message: “In the Game destructor.” Include appropriate get/set functions for the class. In main(), prompt the user to enter the number of games he or she has played in the past year. Dynamically create a built-in array based on this number (not a vector or object of the array class) to hold pointers to Game objects. Construct a loop in main() that executes once for each of the number of games that the user indicated. Within this loop, ask the user to enter the name and genre of each game. Using a random number generator, generate a difficultyLevel between 1-10 (inclusive). Seed this random number generator with 100. Next, dynamically create a Game object (remember that this…arrow_forwardChapter 15 Customer Employee Creator Create an object-oriented program that allows you to enter data for customers and employees. Each class will be stored in its own python file. Console Specifications Create a Person class that provides attributes for first name, last name, and email address. Include a parameter for each attribute in the constructor method. This class will provide a property or method that returns the person’s full name. Create a Customer class that inherits the Person class. This class must add an attribute for a customer Create an Employee class that inherits the Person class. This class must add an attribute for a social security number (SSN). Put the above three classes in a module named ‘company_objects’, separate from the application module. The program will create a Customer or Employee object from the data entered by the user and store the object in a single variable. Create a function that will display the Customer or Employee. The function will have a…arrow_forwardParking Ticket SimulatorFor this assignment you will design a set of classes that work together to simulate apolice officer issuing a parking ticket. The classes you should design are:• The Parkedcar Class: This class should simulate a parked car. The class's respon-sibilities are:To know the car's make, model, color, license number, and the number of min-utes that the car has been parkedThe BarkingMeter Class: This class should simulate a parking meter. The class'sonly responsibility is:- To know the number of minutes of parking time that has been purchased• The ParkingTicket Class: This class should simulate a parking ticket. The class'sresponsibilities areTo report the make, model, color, and license number of the illegally parked carTo report the amount of the fine, which is $2S for the first hour or part of anhour that the car is illegally parked, plus $10 for every additional hour or part ofan hour that the car is illegally parkedTo report the name and badge number of the police…arrow_forward
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT