Write a program that determines whether a meeting room is in violation of fire law regulations regarding the maximum room capacity. The program will read in the maximum room capacity and the number of people attending the meeting. If the number of people is less than or equal to the maximum capacity, the program announces that it is legal to hold the meeting and tells how many additional people may legally attend. If the number of people exceeds the maximum room capacity, the program announces that the meeting cannot be held as planned due to fire regulations and tells how many people must be excluded in order to meet the fire regulations.
#include iostream
usingnamespace std;
int main ()
{
int number;
int roomcapacity;
char choice ;
do
{
cout << "Enter the room capacity :";
cin >> roomcapacity;
cout << "Enter number of people in the meeting :";
cin >> number;
if(number <= roomcapacity)
cout << "You can hold the meeting legally!";
elseif (number > roomcapacity)
{
cout <<"Warning! you can't hold the meeting. But if you still want to hold" < <<"the meeting you have to exclude: " << (number - roomcapacity) << " guest(s)";
}
cout << endl << "Do you want to run the program again? y/n ";
cin >> choice;
cout << endl << endl;
}
while ( choice =='y' || choice == 'Y');
cout << "\nEnd of Program\n\n";
return 0;
}
Every time I run the program, it throws an error on Line 13: cout << "Enter the room capacity :";
Can someone please help me get this straightened out and let me know what I am doing wrong?????
#include <iostream> //You forgot to add angle brackets <> ,, so Syntax error
usingnamespace std;
int main ()
{
int number;
int roomcapacity;
char choice ;
do
{
cout << "Enter the room capacity :";
cin >> roomcapacity;
cout << "Enter number of people in the meeting :";
cin >> number;
if(number <= roomcapacity)
cout << "You can hold the meeting legally!";
elseif (number > roomcapacity)
{
cout <<"Warning! you can't hold the meeting," << endl;
cout << "But if you still want to hold the meeting you have to exclude: " << (number - roomcapacity) << " guest(s)"; // Deleted " < <<" because they are syntax error to complier and won't complie, they were unnessecarry.
}
cout << endl << endl << "Do you want to run the program again? <y/n> ";
cin >> choice;
cout << endl << endl;
}
while ( choice =='y' || choice == 'Y');
cout << "\nEnd of Program\n\n";
return 0;
}