Department Selection.|| By Switch statement
#include
<iostream>
#include
<stdlib.h>
using
namespace std;
int
main() {
int
num,num1,num2,num3;
cout
<< "1. School of Computer Science" << endl;
cout
<< "2. School of Business" << endl;
cout
<< "3. School of Engineering" << endl;
cout
<< "MAKE YOUR SELECTION W.R.T NUMBERS : ";
cin
>> num;
if
(num == 1)
{
cout
<< "available departement "
<< endl;
cout
<< "1. Department of Informatics" << endl;
cout
<< "2. Department of Machine Learning" << endl;
cout
<< "make selection "
<< endl;
cin
>> num1;
switch
(num1)
{
case
(1):
cout
<< "YOU CHOOSE Department of Informatics " << endl;
break;
case
(2):
cout
<< "you choose Department of Machine Learning" << endl;
break;
default:
cout
<< "wrong input" << endl;
}
}
else
if (num == 2)
{
cout
<< "available departement "
<< endl;
cout
<< "1. Department of Commerce" << endl;
cout
<< "2. Department of purchasing" << endl;
cout
<< "make selection "
<< endl;
cin
>> num2;
switch
(num2)
{
case
(1):
cout
<< "YOU CHOOSE. Department of purchasing " << endl;
break;
case
(2):
cout
<< "you choose Department of Commerce" << endl;
break;
default:
cout
<< "wrong input" << endl;
}
}
else
if (num == 3)
{
cout
<< "available departement "
<< endl;
cout
<< "1. Department of Mechanical Engineering" << endl;
cout
<< "2. Department of Mechatronics Engineering" << endl;
cout
<< "make selection "
<< endl;
cin
>> num3;
switch
(num3)
{
case
(1):
cout
<< "YOU CHOOSE Department of Mechatronics Engineering "
<<endl;
break;
case
(2):
cout
<< "you choose Mechanical Engineering" << endl;
break;
default:
cout
<< "wrong input" << endl;
}
}
system("pause");
return
0;
}
Comments
Post a Comment