Concept explainers
Patient Fees
1. This
- One or more students may work on a single class.
- The requirements of the program should be analyzed so that each student is given about the same workload.
- The parameters and return types of each function and class member function should be decided in advance.
- The program will be best implemented as a multi-file program.
2. You are to write a program that computes a patient’s bill for a hospital stay. The different components of the program are
The PatientAccount class
The Surgery class
The Pharmacy class
The main program
- The PatientAccount class will keep a total of the patient’s charges. It will also keep track of the number of days spent in the hospital. The group must decide on the hospital’s daily rate.
- The Surgery class will have stored within it the charges for at least five types of surgery. It can update the charges variable of the PatientAccount class
- The Pharmacy class will have stored within it the price of at least five types of medication. It can update the charges variable of the PatientAccount class.
- The student who designs the main program will design a menu that allows the user to enter a type of surgery and a type of medication, and check the patient out of the hospital. When the patient checks out, the total charges should be displayed.
Want to see the full answer?
Check out a sample textbook solutionChapter 13 Solutions
Starting Out With C++ From Control Structures Through Objects, Student Value Edition (8th Edition)
Additional Engineering Textbook Solutions
Java How To Program (Early Objects)
Starting Out with C++: Early Objects
Web Development and Design Foundations with HTML5 (8th Edition)
C Programming Language
Starting Out with Java: From Control Structures through Objects (6th Edition)
Modern Database Management (12th Edition)
- help with c++ paste indented code plzz Have to use given main function to test your answer Q2: Continue with House class:a) Copy the previous program to a new file.b) Write Constructor with two parameter, and assign to location, and price.c) Write default constructor, initialize location to “TBD”, price to 0, Implement constructor delegationd) implement a non-member function names output that will print all information of House object. Use following main() to test your class. int main(){House a("1234 qcc st, Bayside, NY",1000000); output(a); House b; output(b); } Output from given main: Location: 1234 qcc st, Bayside, NY Price: 1000000 Location: TBD Price: 0\ ANSWER:arrow_forwardResearch assistants provide support to professionals who are conducting experiments or gathering andanalyzing information and data. Suppose you are working as RA (research assistant) with a Professor who isworking on a project and evaluating complex mathematical equations. Your duty is to assist him, so in thisregard he has assigned a task to you. Your task is to write a oop c++ program to create a class named equation which will have the data members a, b and c which are the coefficients of the quadratic equation. The class will have two more data members namely proot and nroot which stand for the positive root and negative root of the equation. Suppose that variables a, b and c are integers. Where proot and nroot are floats. Input Function to get values of a, b and c Then design a friend function which will determine the proot and nroot of the equation. Create another friend function which will display the values of proot and nroot.arrow_forwardThis is an object oriented programming question The code should be in C++ language Create a class Student having a private data members S_ID, S_Name and S_CGPA. Now create a public member functions void getID(), void getName() and getCGPA() and finally to display all the data members, create a function void display(). In the main(), create an array of student class, size of the array should be taken from user at run time and call all the functions defined in the class. Sample Output: Student 1 Enter ID: 1 Enter Name: Ali Enter CGPA: 2.5 Student 2 Enter ID: 2 Enter Name: Ahmed Enter CGPA: 2.9 Student 3 Enter ID: 3 Enter Name: Zain Enter CGPA: 3.4 Student 1 informationID: 1 Name: Ali CGPA: 2.5 Student 2 information ID: 2 Name: Ahmed CGPA: 2.9 Student 3 information ID: 3 Name: Zain CGPA: 3.4arrow_forward
- The program has to be in c++ Can someone help with this program?Create a Student class with member-data name and average success and member-functions• Designers• get & set• member-function (method), returning the first letter of the student's nameWrite external functions with a vector parameter from students• To read a list of Student objects (vector <Student>) from a file (the file is submitted as a second parameter)• To display a list of students on the screen• To calculate the average success of a list of students Write two sorting functions - by name and by average success.In main (), create an empty vector of students and illustrate the application of the written external functions (they in turn use the member functions of the Student class).arrow_forwardWAP to read the class object of student info such as name, age and rollno from the keyboard and to store them on a specified file using read() and write() functions Again the same file is opened for reading and displaying the contents of the file on the screen. File Handling In C++arrow_forwardC++ Dynamic Programs Hoskins College offers both curriculum and continuing education courses. Write a program that dynamically tracks these courses using an array of object pointers. Every course (both curriculum and continuing education) has a course id, title, room number, and number of contact hours. A curriculum course has credit hours and tuition rate. Tuition is calculated by multiplying the course's credit hours by tuition rate. A continuing education course has a flat fee (cost). Implement a show() function in every class that displays the data in the object. Part A: Create an inheritance-based collection of classes to represent these different courses. Include code in main to test your work by instantiating objects of the two derived classes. Part B: Modify your program. Remove the objects you created in main to test the classes. Modify the base class so that show() becomes a virtual class. In main, create a single array capable of holding pointers to objects of both…arrow_forward
- I have the basis of a program that works as an inventory, it reads the contents of a file and displays them and their quantity in three places, listed below are the things that I need to add to the program below. Provided is the current code. 1) Convert your structure into a class. For this exercise, you can leave the data as public (otherwise you would have to change the input and output functions). 2) Write a member function show_all that prints all the information for one record - name, cost, markup, and the three inventory numbers. 3) Add a user option S that lets the user see all the information for all the items in the inventory, using the show_all member function. Print a header so the user knows what each column means, and format the output to appear in columns. Hint: do a setwidth() before *each* cout. Pick widths that make sense for name, cost, markup, and the three inventory numbers. Contents of the file: Contents of Inventory.txt Red delicious apples1.00 25 6 8…arrow_forwardWrite a class Employee with data members Name, Id, and Salary. Derive two classes, Faculty with data members Department, and role(permanent or visiting) and derived class Management with data members Department and rank (manager, deputymanager, etc.). Create getters,settersfor all thedata members, create constructors,destructors and show functions for all the classes.Create a write function to write employees on a file . In main function create two objects of each derived class using parameterized constructors, call the show function to show all four objects, write all four objects to a file. Your submission should include the output file.arrow_forwardThis program should be designed and written by a team of students. Here are somesuggestions:o One student should design function main, which will call the other functions inthe program. The remainder of the functions will be designed by other membersof the team.o The requirements of the program should be analyzed so each student is givenabout the same work load.o The parameters and return types of each function should be decided in advance.o The program can be implemented as a multi-file program, or all the functions canbe cut and pasted into the main file.Here is the assignment: Write a program that can be used by a small theater to sell tickets forperformances. The theater’s auditorium has 15 rows of seats, with 30 seats in each row. Theprogram should display a screen that shows which seats are available and which are taken.For example, the following screen shows a chart depicting each seat in the theater. Seats thatare taken are represented by an * symbol, and seats that are…arrow_forward
- (In C++ Pls) This program should be designed and written by a team of students. Here are some suggestions: You may work on a single class. The parameter and return type s of each function and class member function should be decided in advance. The program will be best implemented as a multi-file program, (header file, the main program,..) You need to print all output to an output file and submit it to the instructor during the final exam. Design a generic class to hold the following information about a bank account: Balance Number of deposits this month Number of withdrawals Annual Interest Rate Monthly service charges The class should have the following member function: Constructors Accepts arguments for the balance and annual interest rate. deposit a virtual function that accepts an argument for the amount of the deposit. The function should add the argument to the account balance. It should also increment the variable holding the…arrow_forwardIn C++ Please: The class and functions need to be on an .h file while the main needs to be small and on a seperate .cpp file. Create a class AccessPoint with the following attributes: x - a double representing the x coordinate y - a double representing the y coordinate range - an integer representing the coverage radius status - On or Off Add constructors. The default constructor should create an access point object at position (0.0, 0.0), coverage radius 0, and Off. Add accessor and mutator functions: getX, getY, getRange, getStatus, setX, setY, setRange and setStatus. Also, add a set function that sets the location coordinates and the range. Add the following member functions: move and coverageArea. Add a function overlap that checks if two access points overlap their coverage and returns true if they overlap. Add a function signalStrength that returns the wireless signal strength as a percentage. The signal strength decreases as one moves away from the access point location. Test…arrow_forwardCreat a program which can process multiple groups. These groups are on the input separated by ’=\n’. Every group starts with a first line that contains the name of the group and the lines after contain the information about the students in the same way as the text file. The program needs to be written in Python, and needs to make use of functions and input parsers. With the input 1bErik Eriksen__________4.3 4.9 6.7Frans Franssen________5.8 6.9 8.0=2bAnne Adema____________6.5 5.5 4.5Bea de Bruin__________6.7 7.2 7.7Chris Cohen___________6.8 7.8 7.3Dirk Dirksen__________1.0 5.0 7.7 The output should be: Report for group 1bErik Eriksen has a final grade of 6.0Frans Franssen has a final grade of 7.0End of reportReport for group 2bAnne Adema has a final grade of 6.0Bea de Bruin has a final grade of 7.0Chris Cohen has a final grade of 7.5Dirk Dirksen has a final grade of 4.5End of reportarrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning