Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Programming: First, the program should ask if the patient was admitted as in in-patient or an out-patient. The user can enter the letter i

C++ Programming:

image text in transcribed

First, the program should ask if the patient was admitted as in in-patient or an out-patient. The user can enter the letter i or I for in-patient, or the letter o or O for out-patient. Write a function called Menu, which takes no input parameters and returns a char value. Your main program will call this Menu function, which will prompt the user to enter the category ('i'or 'l' for in-patient or 'o'or 'O' for in-patient) and return the char entered by the user to your main program. Next in the main program, use the switch statement to get additional information from the user and compute the charges If the patient was an in-patient, ask the user to enter the following information: The number of days spent in hospital The daily rate costs for labs costs for medicine Do not accept negative numbers for any of the information. Charges for in-patient = days*rate + cost of labs + cost of medicine. Write a function called charges to calculate the charges due and call the function from your main program. This function should be overloaded with another function (see gray highlighted text below). This will be the one of the overloaded functions and it should accept arguments for the in-patient data. The function returns the total charges. If the patient was an out-patient, ask the user to enter the following information: costs for labs costs for medicine Do not accept negative numbers for any of the information. Charges for out-patient = cost of labs + cost of medicine. Write a function called charges to calculate the charges and call the function from your main program. This function is overloaded with the charges function described above (see gray highlighted text above). While the function above accept arguments for the in-patient data, this overloaded function accepts arguments for out-patient data. The function returns the total charges

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Antipatterns Avoiding The Pitfalls Of Database Programming

Authors: Bill Karwin

1st Edition

1680508989, 978-1680508987

More Books

Students also viewed these Databases questions