Help with a code

Community Hospital needs a program to compute and print a billing statement for each patient.
Charges for each day are as follows:
a. room charges: private (P) room = $125.00; semi-private (S) room = $95.00; or ward (W) = $75.00
b. telephone charge = $1.75
c. television charge = $3.50
Write a program to get data from the keyboard, compute the patient’s bill, and print an appropriate statement. Typical input (nut yours do not have to be identical to this) is the following:
How many days was the room occupied? 5
What type of room? P
Telephone used during the stay? N
Television used during the stay? Y

Keep in mind that the user needs to know that the input can be any integer number of days for the length of stay, either (P, S, or W) for the room type, and either (Y or N) for both telephone and television options.

A statement (which yours MUST be identical to) for the data given follows:

Community Hospital Patient Billing Statement

Number of days in hospital: 5
Type of room: Private
Room charge: $ 625.00
Telephone charge: $ 0.00
Television charge: $ 17.50

TOTAL DUE = $642.50
CAN SOMEONE PLEASE HELP ME.
What do you have so far?
im really new to this but this is what i have so far. i dont know if i started it off right


#include <iostream>
using namespace std;
const float P=125.00, S=95.00, W=75.00

int main ()
{

float Number of days in hospital, Type of room, telephone charge, television charge , Room charge;
int two;

'P': cost = 125.00;
'S': cost = 95.00;
'W': cost = 75.00;
'Y': = yes
'N': = no

room charge=
cout<< "Number of days in Hospital" <<Number of days<<;
cout<< "Type of Room" <<P,S,W<<;
@GRex2595
Some of your code looks like it's cut off. This won't work at all.

Get the input for each variable.

The user might enter upper or lowercase variables, so use tolower() or toupper() on your characters. These functions return a lowercase or uppercase version of your character (if applicable). They do not change that variable.

Use a switch case for your characters (looks like you have that).

Calculate charges.

Display output.

When you get this, post your code again.
Topic archived. No new replies allowed.