The 1o1, 1o2, 1o3, and 104 for some reason are not working, if somebody can see my mistake and point it out i would be very grateful, because I am failing to see it,
Thanks much.
#include <iostream>
#include <stdlib.h>
using namespace std;
int main()
{
int roomnum =0 ;
cout << "What's the room number?: ";
cin >> roomnum ;
roomnum = toupper(roomnum );
switch (roomnum)
{
case 101 : cout << "amenities: 1 king sized bed" << endl ;
break;
case 102 :
case 103 :
case 104 : cout << "amenities: 2 double beds" << endl ;
break;
case 201 : cout << "amenities: 1 queen size bed " << endl ;
break;
case 202 : cout << "amenities: 1 queen size bed " << endl ;
break;
case 203 : cout << "amenities: 1 double bed and 1 sofa bed" << endl ;
You declared roomnum as integer thus you must input integer value to it. For instance, you cannot enter 1o2(one 'o' two) in place of 102 (one zero two). If you do so it will obviously be a runtime error. Because you are trying to put a character to an integer variable.