Floors of Hotel, and 13th floor phobia

Hello fellow users,

I am posting this to mainly ask a simple question.
How can I improve the logic of dmy program.
I am suppose to make a program that is suppose to ask users about the number of floors, occupied, and the number of rooms left unoocupied by the user. This is then returned as a percemtage of occupied rooms, occupied rooms, and unoccupied room report. Thanx in advance to the ggreat users on this site!
Here is my code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51

#include <iostream>
using namespace std;

double percentage;
int i, rooms, totalrooms=0, occupied, totaloccupied=0;

int main()
{
	cout<<"========================================================================\n";
	cout<<":::::Welcome To Hotel california, the worst hotel in the Weeest side::::\n";
	cout<<"========================================================================"<<"\n\n";
    int number_of_floors;
    cout<<"Enter the number of floors the hotel has: \n \n";
    cin>>number_of_floors;
	for (i=1;i<=number_of_floors;i++)
	{
		if (number_of_floors == 13)
		{
			cout<<"Sorry, were triskaeidekaphobic...\n\n"; 
			cout<<"Please Re-Enter the number of floors of the hotel has: ";
			cin>>number_of_floors;
		}
		if (number_of_floors < 1)
		{
			cout<<"Sorry, nothing irrational like 0 or negative values, or even characters. Thank You\n\n";
			cout<<"Please Re-Enter the number of floors of the hotel has: ";
			cin>>number_of_floors;
		}

	cout<<"Enter the number of rooms on the "<<i<<" floor:";
        cin>>rooms;
        if (rooms<1)
		{
            while (rooms<1)
			{
            cout<<"The number of rooms should be greater then 1\n";
            cout<<"Enter the number of rooms on the "<<i<<" floor:";
            cin>>rooms;
            }
        }
        totalrooms = totalrooms + rooms;
        cout<<"Enter the number of occupied rooms on the "<<i<<" floor:";
        cin>>occupied;
        totaloccupied = totaloccupied + occupied;
    }
    percentage = (double)totaloccupied/(double)totalrooms*100;
	cout<<"Report:\nTotal number of rooms in the hotel: "<<totalrooms<<"\nnumber of occupied rooms: "<<totaloccupied<<"\nnumber of unoccupied rooms: "<<totalrooms-totaloccupied<<"\npercentage of occupied rooms: "<<percentage<<"%.\r\n";
	system("pause");
}


I am also wanting to avoid the 13th floor, that is why I placed a counter at the end and wanted to know also how to avoid characters like an 'A' with in my code as an imput. If anybody could check this code for some more bugs other than the obvious of imput more than twice and the code might not go back normal, than iit would be greatly appreciated.
Topic archived. No new replies allowed.