-
Notifications
You must be signed in to change notification settings - Fork 0
/
dc-deducer.cpp
44 lines (38 loc) · 1.03 KB
/
dc-deducer.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
#include <iostream>
#include <string>
#include "accounts.h"
bool checkDebit(signed int amount) {
if (amount > 0) {
return true;
}
}
bool checkCredit(signed int amount) {
// If amount is bigger than 0 and is a credit account, it means it's a
// negative amount hence must be credit. If it's a positive number than debit.
if (amount < 0) {
return true;
}
}
int main() {
std::std::string accountType;
signed int amount;
std::cout << "Enter Account Type: ";
std::cin >> n;
std::cout << "Enter Amount: ";
std::cin >> amount;
if (accountType == "Assets" || accountType == "Expenses") {
checkDebit(amount);
} else if (accountType == "Liabilities" | "Equity" | "Revenue") {
checkCredit(amount);
else {
std::cout << "Invalid account type" << "\n";
}
}
}
processAccount(accountType);
return 0;
}
// Assets bank 100
// should return its a debit transaction
// Assets bank -100
// should return its a credit transaction.