Line 10 : missing ;
Line 11: login_attempt is undeclared variable.
Line 38: What are you trying to do? Are you trying to call a function?
Line 82: What are you trying to do? Are you trying to call a function?
Line 92-94: Statement is empty.
Line 99: What are you trying to do? Are you trying to call a function?
Line 108 : You are having int variable = int variable * 0.15. The answer will be an int and would drop the numbers after the decimal. (i.e 0 = 5 * 0.15). If the variable was a float or double like (double a = 5 * 0.15) the answer will be 0.75.
Line 121: Same issue as line 108.
Those were the issues I could find with my time.
I would avoid the use goto. I would use loops or another flow method of the code.
while (1) // Since it is stating the obvious, then it will keep looping.
{
system("cls");
cout << "Please enter password: ";
cin >> password;
if (password == 123456) //This sets the condition for success
{
cout << "Access Granted!!!!";
}
elseif (password != 123456) //This sets the condition for failure
{
cout << "Wrong password" << "\n" << x << " " << "wrong attempts" << "\n";
++x;
}
if (x > 3)
{
goto exit;
}
}
For example:
In the loop below, If number had been initialized with
the value 5 or greater, as shown in the following program segment, the loop would never
execute:
1 2 3 4 5 6
int number = 6;
while (number < 5)
{
cout << "Hello\n";
number++;
}
An important characteristic of the while loop is that the loop will never iterate if the test
expression is false to start with. If the variable number is less than 5, then the loop will execute.