Alt kısımda çalışmaz ise; evcil hayvanların gerçekten var olmadığını söylüyor."Kodunuz Asla Yürütülmez" Bildirimi
void checkIn()
{
int roomNum = 0;
int party = 0;
char pets;
char smoke;
cout << "----------------------------" << endl;
cout << "Welcome to Shrek's Swamp Inn" << endl << endl;
cout << "How many people are In your party? " << endl;
cin >> party;
cout << "Do you have pets? (Y/N)" << endl;
cin >> pets;
switch (pets)
{
case 'Y' : case 'y':
cout << "GTLO" << endl;
break;
case 'N' : case 'n':
cout << "cool cool" << endl;
break;
default :
cout << "User error" << endl;
}
cout << "Do you want a smoke room? (Y/N) " << endl;
cin >> smoke;
switch (smoke)
{
case 'Y' : case 'y':
cout << "GTLO" << endl;
break;
case 'N' : case 'n':
cout << "cool cool" << endl;
break;
default :
cout << "User error" << endl;
}
if((pets == 'Y' || 'y') && (smoke == 'Y' || 'y')){
roomNum = rand() % 4 + 1;
cout << "Your room is " << roomNum << "S" << endl;
}
else if((pets == 'Y' || 'y') && (smoke == 'n' || 'N')){
roomNum = rand() % 8 + 5;
cout << "Your room is " << roomNum << "P" << endl;
}
else if((pets == 'n' || 'N') && (smoke == 'n' || 'N'));{
roomNum = rand() % 15 + 9;
cout << "Your room is " << roomNum << "R" << endl;
}
}
kaldırmak gerekir sonlarına doğru noktalı virgül
;
? – juanchopanza