$24.99
Objective:
The purpose of this lab project is to exposes you modular programming, use selection, and modify/add/complete others work.
Problem Specification:
The St. Joseph’s Hospital needs a program to compute and print a statement of charges for patients being discharged from the hospital.
The software designer provided you with the included C++ program and you are asked to make a working program using the given logic and the following information.
Charges for each day are as follows:
a. Room Rates are:
1. Single room-One bed $525.00
2. Double room Two beds $325.00
3. Ward $550.00
b. Phone Access rates (if the customer wants access)
1. Shared line $2.95
2. Dedicated line $5.95
c. Television Rates (if the customer wants a TV)
1. Basic Channels $2.95
2. Cable channels $5.95
Your input to the program consists of the customer’s name and the number of days they stayed in the hospital, Room type, Phone access and TV access. Options are chosen from menus to handle each of the inputs
A sample input for the program would be:
Patient name: Eddie Atshan
Number of Days in the Hospital: 3
Room Used
__________
1- Single room-One bed
2- Double room two beds
3- Ward
Enter Choice 1, 2, or 3: 1
Phone usage (Y/N): Y
Phone Access
___________
1- Shared
2- Dedicated
Enter Choice 1 or 2: 1
TV Usage (Y/N): Y
TV Usage
________
1- Basic Channels
2- Cable Channels
Enter Choice 1 or 2: 1
A sample output statement would be:
St. Joseph’s Hospital
EddieAtshan’sBilling Statement
Number of days in hospital: 2 (in a Single Room)
Room Charges $1575.00
Phone Charges (Shared) $8.85
Television Charges (Cable) $8.85
Total Charges $1592.70
Hope you are satisfied with St. Joseph’s Hospital services, Stay well.
Requirements:
· Follow programming standards in all functions.
· Phone and TV usage may be denied, in that case the charges would be $0.00, and the type is “None”.
· The rates are defined as local constants in the function using them, and are used in calculations.
· Possible room types are (“Single”, “Double” or “Ward”)
· Possible phone types (“None”, “Dedicated”, or “Shared”)
· Possible tv types (“None”, “Basic”, or “Cable”)
· Every function has its specifications detailed above its definition.
· Use descriptive variable names (names to identify what they are storing).
· Use the format modifiersand tabs to format and align output.
Grading criteria:
1. 5 points
Programmer and program information in the form of documentation.
2. 5 points
Appropriate and descriptive identifier names are used.
3. 5 points
Constants are defined correctly, locally and properly.
4. 10 points
Functions specifications explain each function thoroughly.
5. 5 points
Menus are used to allow selection for each of the charge items.
6. 10 points
Room Type, Phone Type and TV Type are stored in corresponding variables and are printed on the statement.
7. 20 points
Each function is self-contained and performs its task.
8. 5 points
Proper headings and footings are displayed.
9. 10 points
Format modifiers and tabs are used to align output and print monies to 2 decimal spaces.
10. 5 points
Flowchart for the function setroom() is handed in and is correct.
11. 15 points
Program runs correctly and performs the task as specified.
12. 5 points
Multiple test runs showing evidence of all requirements are submitted.
Submission Details:
Submit a print-out of: The source program, the Flowchart, pseudopod will not be accepted, a copy of multiple sample statements.
Due Date: 04/06/2016
#include <iostream
#include <cctype
#include <cstdlib
using namespace std;
int main()
{ string name;
stringroomtype, phonetype, tvtype;
int days;
floatroomcharges,phonecharges,tvcharges;
setdata(name,days);
roomcharges = setroom(days,roomtype);
phonecharges = setphone(days,phonetype);
tvcharges = settv(days,tvtype);
print(name,days,roomcharges,phonecharges,tvcharges);
cin.get();
cin.ignore();
return 0;
}