aboutsummaryrefslogtreecommitdiffstats
path: root/ee1301/wk2
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ee1301/wk2/lab2/greektax.cpp31
1 files changed, 15 insertions, 16 deletions
diff --git a/ee1301/wk2/lab2/greektax.cpp b/ee1301/wk2/lab2/greektax.cpp
index f5d8ef3..c1507d1 100644
--- a/ee1301/wk2/lab2/greektax.cpp
+++ b/ee1301/wk2/lab2/greektax.cpp
@@ -1,32 +1,31 @@
#include <iostream>
using namespace std;
int main () {
- int income;
- int tax=0;
- cout << "Enter your income: ";
- cin >> income;
- if (income>10000) {
- int k10=income-10000;
+ int Income;
+ int Tax=0;
+ cout << "Enter your Income: ";
+ cin >> Income;
+ if (Income>10000) {
+ int k10=Income-10000;
if (k10<=0){
- tax+=((income-10000)*.1);
+ Tax+=((Income-10000)*.1);
}
else {
- tax+=2000;
+ Tax+=2000;
}
- if (income>30000) {
- int k30=income-10000;
+ if (Income>30000) {
+ int k30=Income-10000;
if (k30<=0){
- tax+=((income-30000)*.2);
+ Tax+=((Income-30000)*.2);
}
else {
- tax+=8000;
+ Tax+=8000;
}
- if (income>70000) {
- tax+=((income-70000)*.3);
+ if (Income>70000) {
+ Tax+=((Income-70000)*.3);
}
}
}
-
- cout << "You owe " << tax << " drachmas in tax." << endl;
+ cout << "You owe " << Tax << " drachmas in tax." << endl;
}