Concept explainers
Patient Charges
Write a class named Patient that has fields for the following data:
- First name, middle name, and last name
- Address, city, state, and ZIP code
- Phone number
- Name and phone number of emergency contact
The Patient class should have a constructor, accessor, and mutator that accept an argument for each field.
Next, write a class named Procedure that represents a medical procedure that has been performed on a patient. The Procedure class should have fields 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, accessor, and mutator that accept an argument for each field.
Next, write a
Procedure #1: | Procedure #2: | Procedure #3: |
Procedure name: | Procedure name: X-ray | Procedure name: Blood test |
Physical Exam | Date: Today’s date | Date: Today’s date |
Date: Today’s date | Practitioner: Dr. Jamison | Practitioner: Dr. Smith |
Practitioner: Dr. Irvine | Charge: 500.00 | Charge: 250.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.
Learn your wayIncludes step-by-step video
Chapter 6 Solutions
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
Additional Engineering Textbook Solutions
Software Engineering (10th Edition)
Database Concepts (8th Edition)
Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)
Web Development and Design Foundations with HTML5 (9th Edition) (What's New in Computer Science)
Starting Out with C++: Early Objects (9th Edition)
Web Development and Design Foundations with HTML5 (8th Edition)
- The class implementation: The Account class) Design a class named Account that contains: A private int data field named id for the account (default 0). A private double data field named balance for the account (default 0). A private double data field named annuallnterestRate that stores the urrent interest rate (default 0). Assume all accounts have the same interestarrow_forwardProgramming Language= PYTHON 1. Pet Class Write a class named Pet, which should have the following data attributes: • _ _name (for the name of a pet) • _ _animal_type (for the type of animal that a pet is. Example values are ‘Dog’, ‘Cat’, and ‘Bird’) • _ _age (for the pet’s age) The Pet class should have an _ _init_ _ method that creates these attributes. It should also have the following methods: • set_name This method assigns a value to the _ _name field. • set_animal_type This method assigns a value to the _ _animal_type field. • set_age This method assigns a value to the _ _age field. • get_name This method returns the value of the _ _ name field. • get_animal_type This method returns the value of the _ _animal_type field. • get_age This method returns the value of the _ _age field. Once you have written the class, write a program that creates an object of the class and prompts the user to enter the name, type, and age of his or her pet. This data should be stored as the object’s…arrow_forwardA. Car Class Create a Python Program where you 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…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_forward6. Patient Charges Write a class named Patient that has attributes for the following data: • First name, middle name, and last name • Address, city, state, and ZIP code • Phone number ● The Patient class's init__ method should accept an argument for each attribute. The Name and phone number of emergency contact Patient class should also have accessor and mutator methods for each attribute. Next, write a class named Procedure that represents a medical procedure that has been performed on a patient. The Procedure class should have attributes for the following data: • Name of the procedure • Date of the procedure • Name of the practitioner who performed the procedure • Charges for the procedure 107 The Procedure class's __init__ method should accept an argument for each attribute. The Procedure class should also have accessor and mutator methods for each attribute Next, write a program that creates an instance of the Patient class, initialized with sample data. Then, create three…arrow_forwardCIST 1305 UNIT 10 DROP BOX ASSIGNMENT Create the class diagram and write the pseudocode for a class named Computer that holds the make, model, and amount of memory of a computer. Include methods to set the values for each data field, and include a method that displays all the values for each field.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_forwardCar ClassWrite a class named Car that has the following fields:• yearModel. The yearModel field is an int that holds the car’s year model.• make. The make field references a String object that holds the make of the car.• speed. The speed field is an int that holds the car’s current speed. In addition, the class should have the following constructor and other methods.• Constructor. The constructor should accept the car’s year model and make as arguments. These values should be assigned to the object’s yearModel and make fields. The constructor should also assign 0 to the speed field.• Accessors. Appropriate accessor methods should get the values stored in an object’s yearModel, make, and speed fields.• accelerate. The accelerate method should add 5 to the speed field each time it is called.• brake. The brake method should subtract 5 from the speed field each time it is called.Demonstrate the class in a program that creates a Car object, and then calls the accelerate method five…arrow_forwardFocus on classes, objects, methods and good programming style Your task is to create a BankAccount class. Class name BankAccount Attributes _balance float _pin integer Methods init () get_pin() check pin () deposit () withdraw () get_balance () The bank account will be protected by a 4-digit pin number (i.e. between 1000 and 9999). The pin should be generated randomly when the account object is created. The initial balance should be 0. get_pin () should return the pin. check_pin (pin) should check the argument against the saved pin and return True if it matches, False if it does not. deposit (amount) should receive the amount as the argument, add the amount to the account and return the new balance. withraw (amount) should check if the amount can be withdrawn (not more than is in the account), If so, remove the argument amount from the account and return the new balance if the transaction was successful. Return False if it was not. get_balance () should return the current balance.…arrow_forward
- Month Class Exceptions Write a class named Month. The class should have an int field named monthNumber that holds the number of the month. For example, Janauary would be 1, February would be 2, and so forth. In addition, provide the following methods: A no-arg constructor that sets the monthNumber field to 1. A constructor that accepts the number of the month as an argument. It should set the monthNumber value to the value passed as the argument. If a value less than 1 or greater than 12 is passed, the constructor should throw an InvalidMonthNumberException. A constructor that accepts the name of the month, such as “January” or “February”, as an argument. It should set the monthNumber field to the correct corresponding value. If an invalid name is passed, the constructor should throw an InvalidMonthNameException. A setMonthNumber method that accepts an int argument, which is assigned to the monthNumber field. If a value less than 1 or greater than 12 is passed, throw an…arrow_forwardSuper Class : Employee Attributes : Employee_id name, salary Methods : • Read the employee details • Display the employee details Sub class : Salary_details Attributes : HRA,CCA,DA,Gross_salary Methods : • Calculate the HRA, DA,CCA • Calculate the Gross_Salary and return the gross salary • Display the salary details. Driver Class : • Display the employee details and salary details. The following information are required for the assignment Properties with proper data types Methods with proper return types and scope Demonstration of OOP feature (Inheritance) Demonstration of OOP feature (polymorphism) Proper naming convention Proper comments in each program and within program Purpose of each code should be explained. Program Execution (output) Presentation (Word Document)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
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,