I have an assginment and I am having trouble on the math


***Here is what I have to do...


# of people Room Type Price per night

1 budget 100

1 Mid price 200

1 Penthouse NA

2 Budget 200

2 Mid Price 300

2 Penthouse 500

3 Budget NA

3 Mid Price 400

3 Penthouse 1000

Display a welcome screen.

Ask for room type ('1 - budget, etc)

Ask for number of people

Ask for number nights

discover the room rate for requested #people and type

Error if one two NA situation

Calculate Room rate, and total cost for # nights staying



***Here is what I have so far ...

/// PWD 12/2/15 ///

#include <iostream>
#include <windows.h>

using namespace std;

int main()
{

cout << "Hello and Welcome to Hotel Snob " << endl;
Sleep (2000);
cout << "We have 3 different rooms, for three different prices" <<endl;
Sleep (3000);
cout << "===================================" <<endl;
cout << " -The Budget room costs 100 per night " <<endl;
cout << " per person & can hold up to " <<endl;
cout << " 2 people. " <<endl;
cout << "===================================" <<endl;
Sleep (2000);
cout << "-The Mid Price room costs 200 per night" <<endl;
cout << " for 1, person plus 100 for each " <<endl;
cout << " extra person. " <<endl;
cout << "===================================" <<endl;
Sleep (2000);
cout << " -Penthouse rooms must have two or " <<endl;
cout << " more people, they are 500 O" <<endl;
cout << " plus another 500 for a third person. |" <<endl;
Sleep (2000);
cout << "===============================================" <<endl;
cout << " " <<endl;
cout << " Enter the first letter of the room you want " <<endl;
cout << " Next the # of people and number of nights " <<endl;
Sleep (2000);
cout << " " <<endl;
cout << " For Budget rooms enter 'b' " <<endl;
Sleep (1500);
cout << " " <<endl;
cout << " For Mid Price rooms enter 'm' " <<endl;
Sleep (1500);
cout << " " <<endl;
cout << " For Penthouse rooms enter 'p' " <<endl;
Sleep (1500);
cout << " " <<endl;
cout << "===============================================" <<endl;
cout << " " <<endl;
Sleep (1500);

char myRoom;
char myPeople;
char myNight;


cout << "Please enter your desired room:" <<endl;
cin >> myRoom;

// budget
if (myRoom == 'b')
{
cout << "Budget Room" <<endl;
Sleep (1500);
cout << "Enter the number of people in your group: " <<endl;
cin >> myPeople;
}


else if (myRoom == 'm')
{
cout << "Mid Price Room" <<endl;
Sleep (1500);
cout << "Enter the number or people in your group: " <<endl;
cin >> myPeople;
}


else if (myRoom == 'p')
{
cout << "Penthouse Room" <<endl;
Sleep (1500);
cout << "Enter the number of people in your group: " <<endl;
cin >> myPeople;

[(myPeople*100)]
}

return 0;
}

Last edited on
Please put your code between the code tags [code][ code].

Can you also specify what trouble are you having? If you want a good answer, you need to ask a good question.
So the trouble is [(myPeople*100)] would this be a valid way to do a multiplication problem for the total cost of the room and the number of people. Sorry for confusing you with all of the code I just wanted people to understand how it would work its way down to the math problems.

Topic archived. No new replies allowed.