-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.cpp
50 lines (41 loc) · 1.08 KB
/
app.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
#include <iostream>
using namespace std;
int main(int argc, char *argv[]) {
// Your code here
double moneyAmount = 0.0;
void addMoney(double &moneyAmount);
cout << "\n===== EXPENSE TRACKER =====\n";
cout << "\n1 - Add Money";
cout << "\n2 - Withdraw Money";
cout << "\n3 - See Money Amount";
// User input the menu he want to go to
cout << "\nMenu selection : ";
int menuSelection;
cin >> menuSelection;
switch (menuSelection) {
case 1:
cout << "\n===== ADD MONEY =====\n";
addMoney(moneyAmount);
cout << "New Money amout : " << moneyAmount << endl;
break;
case 2:
cout << "\n===== WITHDRAW MONEY =====\n";
break;
case 3:
cout << "\n===== SEE MONEY AMOUNT =====\n";
break;
// case 4:
// cout << "\n===== LATEST TRANSACTION =====\n";
// Gonna keep this one for latter break;
default:
cout << "\nNah, wrong option mate...";
break;
}
return 0;
}
void addMoney(double &moneyAmount) {
double moneyToAdd;
cout << "Amout of roney to add : ";
cin >> moneyToAdd;
moneyAmount = moneyAmount + moneyToAdd;
}