-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproject1.cpp
More file actions
87 lines (85 loc) · 2.82 KB
/
project1.cpp
File metadata and controls
87 lines (85 loc) · 2.82 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#include<iostream>
#include<string>
using namespace std;
class Bank_account
{
private:
string Account_holder_name;
double Account_balence;
int Account_number;
public:
void Create_account(){
cout<<"Welcome in in our Bank"<<endl;
cout<<"Start process to create your Account"<<endl;
cout << "Enter your name: ";
cin >> Account_holder_name;
cout << "Enter account number: ";
cin >> Account_number;
Account_balence = 0;
cout<<"Account Created Sussfully"<<endl;
cout<<"Your Journey is started here ! Thanks for choosing us"<<endl;
}
void deposit_money(){
float deposit_amount;
cout<<"Enter amount to deposit"<<endl;
cin>>deposit_amount;
if(deposit_amount>0){
Account_balence=Account_balence+deposit_amount;
cout<< "Your amount is deposited successfully"<<endl;}
else{
cout<<"Please enter valid amount! "<<endl;
}
}
void Withdraw_money(){
float Withdraw_amount;
cout<<"Enter amount to withdraw"<<endl;
cin>>Withdraw_amount;
if(Withdraw_amount>0 && Withdraw_amount<=Account_balence){
Account_balence=Account_balence-Withdraw_amount;
cout<<"Your amount is Withdrawn Succesfully"<<endl;
}
else{
cout<<"Insufficient balenceto withdraw!"<<endl;
}
}
void display_account_details(){
cout<<"Account_holder_name:"<<Account_holder_name<<endl;
cout<<"Account_number:"<<Account_number<<endl;
cout<<"Available_balence:"<<Account_balence<<endl;
}
};
int main(){
Bank_account Account;
int choice;
do{
cout<<"Welcome to the Bank Management System"<<endl;
cout<<"Please choice an option:"<<endl;
cout<<"1. Create Account"<<endl;
cout<<"2. Deposit Money"<<endl;
cout<<"3. Withdraw Money"<<endl;
cout<<"4. Display Account Details" <<endl;
cout<<"5.Exit"<<endl;
cout<<"Enter your choice:"<<endl;
cin>>choice;
switch(choice){
case 1:
Account.Create_account();
break;
case 2:
Account.deposit_money();
break;
case 3:
Account.Withdraw_money();
break;
case 4:
Account.display_account_details();
break;
case 5:
cout<<"Thank you for using our service!"<<endl;
break;
default:
cout<<"Invalid choice! Please try again."<<endl;
}
}while (choice != 5);
return 0;
}