Even the latest version of Borland C++ supports an old code written for turbo C 1992!
the code had a simple misprint, I corrected:
#include<iostream.h>
#include<conio.h>
#include<iomanip.h>
main()
{
char choice;
char n, i;
int y, z, sum;
char x;
clrscr();
loop:
clrscr();
cout << endl << " Enter Your Password..... < > ";
gotoxy(21, 2);
n = getch();
cout << "*";
if (n != 'y')
{
cout << "\n Wrong Access Code \n\n Hit The ENTER key To continue ";
getch();
goto page;
}
else
{
cout << "\n Access Granted.....\n\n Hit The ENTER key To Continue ";
getch();
clrscr();
cout << "\n C++ calculator Programmed By Igwe Justice Chikaodi ";
cout << "\n Main Menu ";
gotoxy(20, 4);
cout << "\n Press (a) for Addition \n Press (b) for Multiplication \n Enter Choice < > ";
gotoxy(17, 7);
cin >> x;
switch (x)
{
case 'a':
clrscr();
cout << "\n Addition Department : : ";
cout << "\n Enter Two Numbers ";
cin >> y >> z;
sum = ( y + z);
cout << "\n The Sum of " << y << " and " << z << " is " << setw(6) << sum << endl;
cout << "\n Thank You ";
getch();
break;
case 'm':
clrscr();
cout << "\n Multiplication Department : : ";
cout << "\n Enter Two Numbers ";
cin >> y >> z;
sum = ( y * z);
cout << "\n The Procuct of " << y << " and " << z << " is " << setw(6) << sum << endl;
cout << "\n Thank You ";
getch();
break;
default:
cout << "\n Hope U enjoyed The Calculator ";
}
page:
clrscr();
cout << "\n Do You want To Continue again (y/n) : ";
cin >> choice;
if ((choice == 'y') || (choice == 'Y'))
{
goto loop;
}
else
if ((choice == 'n') || (choice == 'N'))
{
cout << "\n ThanK You For Using Igwe's Program ";
}
}
getch();
}
for a longer password you should add a loop.