-
Notifications
You must be signed in to change notification settings - Fork 0
/
PinnintiPohane_LA1_Account.cpp
64 lines (64 loc) · 1.1 KB
/
PinnintiPohane_LA1_Account.cpp
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
//#include <iostream>
//using namespace std;
//
//class account {
//private:
// int balance;
//public:
// account(int = 0);
// void credit(int);
// void debit(int);
// int getbalance();
//};
//
//account::account(int b) {
// if (b >= 0) {
// balance = b;
// cout << "initial balance is valid" << endl;
// }
// else {
// balance = 0;
// cout << "initial balance is invalid" << endl;
// }
//};
//
//void account::credit(int b) {
// balance += b;
//};
//
//void account::debit(int b) {
// if (b > balance) {
// cout << "debit amount exceeded account balance" << endl;
// }
// else {
// balance -= b;
// }
//}
//
//int account::getbalance() {
// return balance;
//}
//
//int main() {
//
// int test;
// cin >> test;
//
// int joke;
// cin >> joke;
//
// account sohum;
// // account sohum(213);
// account shaadi(joke);
//
// sohum.credit(1);
// shaadi.credit(10);
//
// sohum.debit(499);
// shaadi.debit(9);
//
// cout << "sohum's balance: " << sohum.getbalance() << endl;
// cout << "shaadi's balance: " << shaadi.getbalance() << endl;
//
// return 0;
//}