c++ error

Can anyone give me a hand with this error?


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
#include <iostream>

using namespace std;

int main()
{
    char lang;
    char type;
    char account;
    int pin;
    int attempt = 0;
    int balance = 3230;
    int balance2 = 6000;
    int request;
    cout << "Please Select your language" << endl;
    cout << "Enter E for English o S para español" << endl;
    cin >> lang;
        if ( lang==E || lang==e && attempt != 3){
        cout << "Please Enter your pin number" << endl;
        cin >> pin;
            if (pin = 15592){
            cout << "Success Accessing account" << endl;
            cout << "Enter S for Savings or C for Checking" << endl;
            cin >> type;
                if (type=C || type=c)
                {
                    cout << "Would you like to withdraw from your Checking or Deposit" << endl;
                    cout << "Enter W for Withdraw or D for Deposit" << endl;
                        if (account=w || account=W){
                        cout << "Enter the ammout you would like to withdraw" << endl;
                        cin >> request;
                            if (request > balance){
                            cout << "You do not have that much in your" << endl;
                            }
                            else {
                            request - balance;
                            cout << "You have withdrawn the funds from your account, your new account balance is: " << balance << endl;
                            cout << "Would you like to make another Transaction?" << endl;
                            cout << "Enter Y for yes or N for no." << endl;
                            }
                        else if(account==D || account==d)
                        {
                        cout << "Please Insert your money" << endl;
                        }
                        else {
                        cout << "You entered a letter other then W or D" << endl;
                        }
                }
                else if (type==S || type==s){
                cout << "Would you like to withdraw from your Savings or Deposit" << endl;
                cout << "Enter W for Withdraw or D for Deposit" << endl;
                    if (account=w || account=W){
                    cout << "Enter the ammout you would like to withdraw" << endl;
                    cin >> request;
                        if (request > balance2){
                        cout << "You do not have that much in your" << endl;
                        }
                        else {
                        request - balance2;
                        cout << "You have withdrawn the funds from your account, your new account balance is: " << balance2 << endl;
                        cout << "Would you like to make another Transaction?" << endl;
                        cout << "Enter Y for yes or N for no." << endl;
                        }
                    else if (account==D || account==d)
                    {
                    cout << "Please Insert your money" << endl;
                    }
                    else {
                    cout << "You entered a letter other then W or D" << endl;
                    }
            }
            else {
            cout << "That pin number is incorect" << endl;
            attempt =+ 1;
                if (attempt==3){
                cout << "Account locked out" << endl;
                }
            }
       else if(lang=S || lang=s && attempt != 3){
            cout << "Por favor, introduzca su número de PIN" << endl;
            cin >> pin;
            if (pin = 15592) {
            cout << "El éxito acceder a la cuenta" << endl;
            cout << "Ingrese S para el ahorro o C para la Comprobación" << endl;
            cin >> type;
                if (type = C | | type = c)
                {
                    cout << "¿Le gustaría retirarse de su cuenta corriente o depósito" << endl;
                    cout << "Introduzca W para el Retiro o D para el Depósito" << endl;
                        if (account = w | | account= W) {
                        cout << "Introduzca el ammout que le gustaría retirarse" << endl;
                        cin >> request;
                            if (request > balance) {
                            cout << "Usted no tiene que gran parte de su" << endl;
                            }
                            else {
                            request - balance;
                            cout << "Se han retirado los fondos de su cuenta, el saldo de su nueva cuenta es:" << balance << endl;
                            cout << "¿Desea realizar otra transacción?" << Endl;
                            cout << "S para Sí o N para no." << Endl;
                            }
                        else if (account == D | | account == d) {
                        cout << "Inserte su dinero" << endl;
                        }
                        else {
                        cout << "Ha escrito una carta de otra entonces W o D" << endl;
                        }
                }
                else if (type == S | | type == s) {
                cout << "¿Le gustaría retirarse de sus ahorros o de depósito" << endl;
                cout << "Introduzca W para el Retiro o D para el Depósito" << endl;
                    if (account = w | | account = W) {
                    cout << "Introduzca el ammout que le gustaría retirarse" << endl;
                    cin >> request;
                        if (request > balance2) {
                        cout << "Usted no tiene que gran parte de su" << endl;
                        }
                        else {
                        request - balance2;
                        cout << "Se han retirado los fondos de su cuenta, el saldo de su nueva cuenta es:" << balance2 << endl;
                        cout << "¿Desea realizar otra transacción?" << Endl;
                        cout << "S para Sí o N para no." << Endl;
                        }
                    else if (account == D | | account == d) {
                    cout << "Inserte su dinero" << endl;
                    }
                    else {
                    cout << "Ha escrito una carta de otra entonces W o D" << endl;
                    }
            }
            else {
            cout << "Que el número de pin es incorrecto se" << endl;
            attempt =+ 1;
                if (attempt == 3) {
                cout << "Cuenta bloqueada" << endl;
                }
            }
       else {
            cout << "You did not select E for English nor S for Spanish, Please Try again." << endl;
            cout << "No ha seleccionado E para Inglés, ni S para español, por favor intente de nuevo." << endl;
            }
return 0;
}






C:\Users\Jamin\Desktop\Citizens-test\atm2\main.cpp||In function 'int main()':|
C:\Users\Jamin\Desktop\Citizens-test\atm2\main.cpp|18|error: 'E' was not declared in this scope|
C:\Users\Jamin\Desktop\Citizens-test\atm2\main.cpp|18|error: 'e' was not declared in this scope|
C:\Users\Jamin\Desktop\Citizens-test\atm2\main.cpp|21|warning: suggest parentheses around assignment used as truth value|
C:\Users\Jamin\Desktop\Citizens-test\atm2\main.cpp|25|error: 'C' was not declared in this scope|
C:\Users\Jamin\Desktop\Citizens-test\atm2\main.cpp|25|error: 'c' was not declared in this scope|
C:\Users\Jamin\Desktop\Citizens-test\atm2\main.cpp|29|error: 'w' was not declared in this scope|
C:\Users\Jamin\Desktop\Citizens-test\atm2\main.cpp|29|error: 'W' was not declared in this scope|
C:\Users\Jamin\Desktop\Citizens-test\atm2\main.cpp|36|warning: statement has no effect|
C:\Users\Jamin\Desktop\Citizens-test\atm2\main.cpp|59|warning: statement has no effect|
C:\Users\Jamin\Desktop\Citizens-test\atm2\main.cpp|82|warning: suggest parentheses around assignment used as truth value|
C:\Users\Jamin\Desktop\Citizens-test\atm2\main.cpp|97|warning: statement has no effect|
C:\Users\Jamin\Desktop\Citizens-test\atm2\main.cpp|119|warning: statement has no effect|
||=== Build finished: 42 errors, 6 warnings ===|



cut some of the log off to be able to post.
in lines 18, 25, and 29 you need ' ' around your char literals. for example line 18 should be if ( lang=='E' || lang=='e' && attempt != 3){

the errors saying statement has no effect is because you are doing
request - balance;
and you need to be assigning it to something
and on line 82 you do
if (pin = 15592) {
that just set pin = 15592. you need to do
if (pin ==15592) {
Last edited on
Topic archived. No new replies allowed.