-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGroup7_ATMsystem_BSCS.cpp
More file actions
106 lines (84 loc) · 2.52 KB
/
Group7_ATMsystem_BSCS.cpp
File metadata and controls
106 lines (84 loc) · 2.52 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
// ATM System
//Group 7
//if else statement ATM program
// Made by Juliana Jasmin D. Aliswag
// BSCS - 1D (STEM)
// October 28, 2020
#include <iostream>
#include <conio.h>
#include <string.h>
using namespace std;
int main ()
{
int deposit = 0;
int amount = 5000;
int withdraw = 0;
int choice = 0;
int PIN = 0;
char keypin;
keypin = 0000;
char comppin;
cout << "Enter your PIN: ";
cin >> PIN;
comppin= (PIN, keypin);
if (PIN==0000)
{
cout << "\nPIN Approved!\n";
cout << "\n\t************************************";
cout << "\n\t* Welcome to Group 7's Special ATM *";
cout << "\n\t* *";
cout << "\n\t* 1. Check Balance *";
cout << "\n\t* 2. Withdraw *";
cout << "\n\t* 3. Deposit *";
cout << "\n\t* 4. Exit *";
cout << "\n\t* *";
cout << "\n\t************************************";
cout << "\n\n";
int balance=1;
int withdraw=2;
int deposit=3;
int Exit=4;
s:
cout << "\nSelect an Operation: ";
cin >> choice;
if (choice==1)
{
cout <<"\nYour current balance is: \n" << amount;
goto s;
}
else if (choice==2)
{
cout << "\nEnter the amount you want to withdraw: ";
cin >> withdraw;
if (withdraw>amount)
{
cout << "\nYou don't have sufficient balance.\n";
goto s;
}
else
{
amount=amount-withdraw;
cout << "\nYour current balance is: \n" << amount;
goto s;
}
}
else if (choice==3)
{
cout << "\nEnter the amount you want to deposit: ";
cin >> deposit;
amount=amount+deposit;
cout << "\nYour current balance is: \n" << amount;
goto s;
}
else if (choice==4)
{
cout << "\nThank You for Trusting Group 7's Services!";
}
}
else if (PIN!=0)
{
cout << "\nInvalid PIN!" << "\nPlease try again.";
}
return 0;
getch();
}