Problem Solving with C++ (10th Edition)
10th Edition
ISBN: 9780134448282
Author: Walter Savitch, Kenrick Mock
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
Chapter 15, Problem 4PP
Program Plan Intro
Creation of program to create and display billing records for patients
Program Plan:
- Define a class “person” to define methods and operations in it.
- Define a constructor “person()” to create new instance of a person.
- Define a method “getName()” to get name of person.
- Define a method “operator=()” to define operation for “=” operator.
- Define a method “operator>>()” to define operation for “>>” operator.
- Define a method “operator<<()” to define operation for “<<” operator.
- Define a class “doctor” to define methods and operations in it.
- Define a constructor “doctor()” to create new instance of a doctor.
- Define a method “gtDctr()” to get name of doctor.
- Define a method “gtDsgntn()” to get designation of doctor.
- Define a method “operator=()” to define operation for “=” operator.
- Define a class “patient” to define methods and operations in it.
- Define a constructor “patient()” to create new instance of a patient.
- Define a method “getPtnt()” to get name of patient.
- Define a method “gtDctr()” to get name of doctor.
- Define a method “gtDsgntn()” to get designation of doctor.
- Define a method “operator=()” to define operation for “=” operator.
- Define a class “billing” to define methods and operations in it.
- Define a constructor “billingt()” to create new instance of billing.
- Define a method “getPtnt()” to get name of patient.
- Define a method “gtDctr()” to get name of doctor.
- Define a method “gtDsgntn()” to get designation of doctor.
- Define a method “gtBill()” to get bill for patient.
- Define a method “operator=()” to define operation for “=” operator.
- Define a main method
- Create instance for “doctor”, “patient” and “billing” classes.
- Call methods in classes to perform specific operations.
- Display the result.
Expert Solution & Answer
Trending nowThis is a popular solution!
Students have asked these similar questions
Write a class named Person with data attributes for a person’s name, address, and telephone number. Next, write a class named Customer that is a subclass of the Person class. The Customer class should have a data attribute for a customer number and a Boolean data attribute indicating whether the customer wishes to be on a mailing list. Demonstratean instance of the Customer class in a simple program.
NOTE: READ CAREFULLY
Design a class named Person and a subclasses named Employee. Make Teacher a subclass of Employee.
A Person has a name, address, and e-mail address. An Employee has an office, salary.
A Teacher has office hours and a subject they teach. They also have a tenure status. Define the tenure status as a constant. The tenure status is either Senior or Junior, and is represented as an integer, where Senior is equal to 1, and Junior is equal to 2.
Each class should have a Default constructor, and a constructor that accepts all arguments. There should be appropriate calls to the superclass within the constructors.
Each class should also have getters and setters for each member variable.
Each class should have a toString method.
Note: You do NOT need to run this in a test program. Just create the classes as indicated above.
Design and implement java program for " Covenant System"; the system stores a covenant name, type and date for each object. Also, each Covenant should have the employee name and ID. The system contains a Covenant class and TestCovenant class. To implement the class, you must: (not exclusively)Make at least one constructor to initialize the object with a Date object and ID.Each private data must have setter and getter method.In the main class you have to create 5 Covenants objects and assign for each object its (name, id, datecreated, Employee name, Employee ID).
Submit UML class diagram
Chapter 15 Solutions
Problem Solving with C++ (10th Edition)
Ch. 15.1 - Is the following program legal (assuming...Ch. 15.1 - Prob. 2STECh. 15.1 - Is the following a legal definition of the member...Ch. 15.1 - The class SalariedEmployee inherits both of the...Ch. 15.1 - Give a definition for a class TitledEmployee that...Ch. 15.1 - Give the definitions of the constructors for the...Ch. 15.2 - You know that an overloaded assignment operator...Ch. 15.2 - Suppose Child is a class derived from the class...Ch. 15.2 - Give the definitions for the member function...Ch. 15.2 - Define a class called PartFilledArrayWMax that is...
Ch. 15.3 - Prob. 11STECh. 15.3 - Why cant we assign a base class object to a...Ch. 15.3 - What is the problem with the (legal) assignment of...Ch. 15.3 - Suppose the base class and the derived class each...Ch. 15 - Write a program that uses the class...Ch. 15 - Listed below are definitions of two classes that...Ch. 15 - Solution to Programming Project 15.1 Give the...Ch. 15 - Create a base class called Vehicle that has the...Ch. 15 - Define a Car class that is derived from the...Ch. 15 - Prob. 4PPCh. 15 - Consider a graphics system that has classes for...Ch. 15 - Flesh out Programming Project 5. Give new...Ch. 15 - Banks have many different types of accounts, often...Ch. 15 - Radio Frequency IDentification (RFID) chips are...Ch. 15 - The goal for this Programming Project is to create...Ch. 15 - Solution to Programming Project 15.10 Listed below...Ch. 15 - The computer player in Programming Project 10 does...Ch. 15 - Prob. 12PP
Knowledge Booster
Similar questions
- We are working in 2D and programming in C#. Create a Point class to represent points in 2D. Create an abstract base class named Shape. It should have a position property as a Point. It should be designed as having Move and Resize methods. Create a Line class using Points, derived from Shape class. Its position should be the center of the line. Create a Polygon class representing a closed polygon of Lines, derived from Shape class. Note that, at construction time, Lines may not be provided in order. The continuity and number of the lines should also be checked for a properly closed Polygon. All geometric entities should be moveable. All shapes should be resizable without changing their central positions. All shapes' positions should be their centroids. Shapes should have areas calculated. Write an example C# Console code to demonstrate your program's abilities.arrow_forwardConsider writing a program to manage a collection of movies. There are three kinds of movies in the collection: dramas, comedies, and documentaries. The collector would like to keep track of each movie's title, the name of its director, and the year the movie was made. Some operations are to be implemented for all movies, and there will also be special operations for each of the three different kinds of movies. How would you design the class(es) to represent this system of movies? Your design should implement the concept of Overridingarrow_forwardYour assignment for this course is to implement a beginner level Book Management System (BMS) in Java language. BMS contains 2 classes: Bookand BookList. The Book class has the following attributes: code: a String object, that hold the book’s code. title: a String object, that hold the book’s title. qua: int variable, that hold the number of books with the same code in the library. price: a double variable, that hold the book’s price. The BookList class contains only one data member: ArrayList<Book> t. When running the program display the menu as below:1. Input & add book(s) to the end.2. Display all books.3. Search a book for given code.4. Update the book’s price for given code.5. Find the (first) max price value.6. Sort the list ascendingly by code.7. Remove the book having given code.8. Load data from file.0. Exit.Notes:(1) The book’s code must be unique in the list.(2) Display all books in format (code, title, quantity, price).(5)…arrow_forward
- Write a C++ program to announce student’s result. Demonstrate this scenario through three classes: Students, Results and Examination. The Student class has data members {1st is roll number and 2nd is name}. Create the class Examination by inheriting the Student class. The Exam class input three subjects Marks out of 100 (OOP, English,Maths). Derive the child classResult from the Exam class and it has its own fields such as total Marks. Based on the total marks students must be declared pass or Fail if the total marks achieved by students equal or greater than 150/300 then only he be declared as Pass. Write an interactive program to model this relationship.arrow_forward3. Explain why the relationship between the PlayingCard, Rank and Suit classes is not an is-a relationship.arrow_forwardI need the answer as soon as possiblearrow_forward
- Write a java program using OOP concept (including data members with their suitable modifier, two constructers (default, and with parameters, and setter and getter methods) to print a student card including university name (Univesiti Tenaga Nasional) student name (string) and student id (string) that will be given by the user. Your Program should have at least two classes Main class to display the student card and StudentCard class to create objects. Your program should also apply exception to ensure valid input, if input is invalid ask the user again to insert until valid input is givenarrow_forwardDefine two classes, Patient and Billing, whose objects are records for aclinic. Derive Patient from the class Person given in Listing 8.1. A Patientrecord has the patient’s name (defined in the class Person) and identification number (use the type String). A Billing object will contain aPatient object and a Doctor object (from Practice program 2). Give yourclasses a reasonable complement of constructors and accessor methods,and an equals method as well. First write a driver program to test all yourmethods, then write a test program that creates at least two patients, at leasttwo doctors, and at least two Billing records and then displays the totalincome from the Billing records.arrow_forwardprogram must be solved by python. The question is second one (change the classes line and matrix) . but you will take initial value from first picture.arrow_forward
- The goal of this assignment is to show a simple implementation of inheritance and polymorphism in Java GUI applications. 2. Define 2 classes Patient and Billing, whose objects are records for a clinic. Derive Patient from class Person. A Patient record has patient's name(defined in Person class) and an identification number(use string type). A Billing object will contain a Patient object and a Doctor object. Give your class appropriate getter and accessor methods and constructors and equals method. Write a driver program to test all your methods. Then write a test program to create at least two Patients and 2 Doctors, and at least 2 Billing records and then display the total income from the Billing records.arrow_forwardin c++ 3. Develop additional classes for Cat, Horse, and GuineaPig overriding the move() and speak() methods. (If you didn’t know, guinea pigs go “wheep wheepLinks to an external site.”). Make sure to also define a constructor and destructor for each of these classes, and that when you run your program, you can also see that the correct constructors and destructors are being called. Recall that a derived class will always call the parents constructors and destructors, so if you see this behavior, that is okay. Just make sure you are also calling the derived class’ constructors and destructors. Test with the modified main: int main (){Mammal* theArray[5];Mammal* ptr;int choice;for (int i = 0; i < 5; i++){cout << "(1)dog (2)cat (3)horse (4)guinea pig: ";cin >> choice;switch (choice){case 1: ptr = new Dog;break;case 2: ptr = new Cat;break;case 3: ptr = new Horse;break;case 4: ptr = new GuineaPig;break;default: ptr = new Mammal;break;}theArray[i] = ptr;}// Iterate through…arrow_forwardanswers all questions and code using javaarrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education