-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.cpp
More file actions
63 lines (61 loc) · 1.66 KB
/
app.cpp
File metadata and controls
63 lines (61 loc) · 1.66 KB
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
#include <iostream>
using namespace std;
double balance=4000;
int passWord=1234;
int choice;
int enteredPassword;
int amount;
void show(){
cout<<"****[Menu]*****\n";
cout<<"* 1:Balance *\n";
cout<<"* 2:WithDraw *\n";
cout<<"* 3:Deposit *\n";
cout<<"* 4:Exit *\n";
cout<<"***************\n";
}
void process(){
cout << "Enter the password: ";
cin >> enteredPassword;
if(enteredPassword==passWord){
cout<<"Hello 😊"<<endl;
do{
show();
cout<<"Please enter Your choice: ";
cin>>choice;
switch(choice){
case 1:
cout<<"Your balance is: "<<balance<<"💸"<<endl;
break;
case 2:
cout<<"****NOTE🚨**** \n Your balance is= "<<balance<<"💸"<<endl;
cout << "Enter amount to withdraw: ";
cin >> amount;
if(amount <= balance) {
balance -= amount;
cout << "Your balance now is = " << balance <<"💸"<< endl;
} else{cout<<"Error ☠\n" ;}
break;
case 3:
cout << "Enter amount to deposit: ";
cin>>amount;
balance += amount;
cout<<"Your balance now is = "<<balance <<" 🤑\n";
break;
case 4:
cout<<"Good bye 😊 ";
break;
default:
cout << "Invalid choice ❌ \n Please choose between (1:4)😃"<<endl;
}
}
while (choice != 4);
}
else {
cout<<"Invalid PassWord 😥";
}
}
int main()
{
process();
return 0;
}