I am new to programming and I need help with my term project. I have made a program that simulates a hotel booking, the problem is that whenever a non-whole number is entered for the first question, it goes into an infinite loop. If you get to the second question and enter a non-whole number it accepts it as a whole number by dropping off anything that comes after the decimal and then skips the next question and stops running the program. 

```
    #include <iostream>
    #include <string>
    using namespace std;

int stay_length (int stay) 
{     
    int nights = stay;
    int total = 0*nights;
    return total;
}

int rooms_booking(int rooms)
{
    int rooms_booked = rooms;
    int total = 0;

    if(rooms_booked > 0)
     {
        total = rooms_booked * 50;
     }
    else
    {
        total = 0;
    }   
    return total;
}

int main(){
    int x;
    string repeat;
    int nights;
    int total = 0;  
    int rooms_avail = 10;
    int rooms;

    cout << "Hello! Welcome to Hotel COMP 150." << endl;
    do {
        if (rooms_avail > 0) {
         cout << "How many nights will you be staying?" << endl;

    }
    else {
        cout << "Sorry, but there are no rooms available. " << endl;
    }
         do {
         cin >> nights;

            if (nights > 0 && nights <= 28)
            {
                int total1 = stay_length(nights);
                cout << "You are staying for " << nights << " nights" << endl;
                cout << "That costs: $" << total1 << endl;
                total = total + total1;
            }
            else
            {
            cout << "You cannot stay less than 1 or more than 28 nights" << endl;
            }

         } while (nights <= 0 || nights >28);

            if (rooms_avail > 0)
            {
                cout << "How many rooms will you be booking?" << endl;
                    cout << "There are " << rooms_avail << " available." << endl;
                    cin >> rooms;

                    if (rooms > 0 && rooms <= rooms_avail)
                    { 
                        int total2 = rooms_booking(rooms);
                        cout << "You are booking " << rooms << " rooms." << endl;
                        cout << "That costs : $" << total2 << endl;
                        total = total + total2;
                        rooms_avail = rooms_avail - rooms;
                    }
                    else if (rooms <= 0 || rooms > rooms_avail)
                    {
                        do{
                            cout << "You can only book a minimum of 1 room or a maximum of " << rooms_avail << endl;
                            cin >> rooms;
                          } while (rooms <= 0 || rooms > rooms_avail );
                          int total2 = rooms_booking(rooms);
                          cout << "You are booking " << rooms << " rooms." << endl;
                          cout << "That costs : $" << total2 << endl;
                          total = total + total2;
                          rooms_avail = rooms_avail - rooms;
                     }
                    else
                    {
                     cout << "You cannot book more than " << rooms_avail << endl;
                    }

             }

             else
             {
                cout << "Sorry, all rooms have been booked." << endl;
             }
    cout << "Your total so far is: $" << total << endl;
    cout << "Would you like to make another booking? Enter 'Y' or 'y' to do so."  << endl;
    cin >> repeat;

         }while(repeat == "Y" || repeat == "y");
    return 0;
}

```