Okay, I need some help. This is a calculator program. The Calculator part works but, I am trying to make a password thing so that only me and my friends can access it. Here is what I though might have worked but, didn't.
#include <iostream>

using namespace std;

int main(void)
{
{
system("TITLE Calculator");
system("COLOR 31");
char cChar;
double x;
double y;
char leave;
char password;
char cDoagain;


do
{
{
cout<<"Please input admin Password: \n";
cin >> password;

{
if ( password == 31 ) {
cout<<"Welcome, GeckoGamer!\n";
system("CLS");
cout<<"Welcome to Anthony's Calculator V. 1.1! (Working on new functions)\n";
cout<<"Last update:22/10/10 19:53\n";
cout<<" \n";
cout<<"If you would like to leave now hit 1. If you would like to stay in the program \nhit 2.\n";
cin >> leave;

switch (leave)
{
case '1':
cout << "Good-bye!\n";
break;

cout<<"Please input the first number you would like to use: \n";
cin >> x;
cout<<"Please input the operation you would like to use: \n" << " +,-,* or /\n";
cin >> cChar;
cout<<"Please input the second number you would like to use: \n";
cin >> y;

switch (cChar)
{
case '+':
cout << "The answer is: \n" << x << " + " <<
y << " = " << (x + y);
break;
case '-':
cout << "The answer is: \n" << x << " - " <<
y << " = " << (x - y);
break;
case '*':
cout << "The answer is: \n" << x << " * " <<
y << " = " << (x * y);
break;
case 'x':
cout << "The answer is: \n" << x << " x " <<
y << " = " << (x * y);
break;
case '/':
if(y == 0){
cout << "That is an invalid operation\n";
}else{
cout << "The answer is: \n" << x << " / " <<
y << " = " << (x / y);
}
break;
default:
cout << "That is an invalid operation\n";
break;
}
cout << "Would you like to start again? (y or n)\n";
cin >> cDoagain;
}
}else {
cout<<"Incorrect password! Please leave the program!\n";
break;
}
cout << "Would you like to start again? (y or n)\n";
cin >> cDoagain;
}
}while (cDoagain == 'Y' || cDoagain == 'y');
system("PAUSE");
return 0;
}
Please help me!