#include <iostream>
#include <stdlib.h>
#include <conio.c>
#include <string>
using namespace std;
bool passwords(void);
int main(){
cout<<"Passwords:"<<endl;
bool access = passwords();
if(access){
cout<<"Access granted.\n\n"<<endl;
cout<<"Press any key to continue.";
getche();
clrscr();
do{
cout << "Select subject:\n";
cout << "" << endl;
cout << "1 : Subject1\n";
cout << "2 : Subject2\n";
cout << "3 : Subject3\n";
int c;
c = 0;
cin >> c;
cout << "\n";
switch (c)
{
case 1 : cout << "Here is information concerning Subject1." <<endl;
cout << "And here is some more information concerning Subject1.\n\n" <<endl;
cout << "Press any key to return to choose another alternative." <<endl;
break;
case 2 : cout << "Here is information concerning Subject2." <<endl;
cout << "And here is some more information concerning Subject2.\n\n" <<endl;
cout << "Press any key to return to choose another alternative." <<endl;
break;
case 3 : cout << "Here is information concerning Subject3." <<endl;
cout << "And here is some more information concerning Subject3.\n\n" <<endl;
cout << "Press any key to return to choose another alternative." <<endl;
break;
default : return 0;
}
getche();
clrscr();
}while(true);
}
if(!access){
cout<<"Access denied."<<endl;
getch();
return 0;
}
}
bool passwords(void){
string ps1="ps1";
string ps2="ps2";
string ps3="ps3";
string ps4="ps4";
string ps5="ps5";
string up1;
string up2;
string up3;
string up4;
string up5;
cin>>up1;
cin>>up2;
cin>>up3;
cin>>up4;
cin>>up5;
if(up1==ps1 && up2==ps2 && up3==ps3 && up4==ps4 && up5==ps5)
return true;
else
return false;
}