aboutsummaryrefslogtreecommitdiffstats
path: root/ee1301/wk2/lab2/greektax.cpp
blob: f5d8ef381ffa6114d47431d53212b52e902e5104 (plain) (blame)
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
#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;
    if (k10<=0){
    tax+=((income-10000)*.1);
  }
    else {
      tax+=2000;
    }
    if (income>30000) {
      int k30=income-10000;
      if (k30<=0){
      tax+=((income-30000)*.2);
    }
      else {
        tax+=8000;
      }
      if (income>70000) {
        tax+=((income-70000)*.3);
      }
    }
  }

  cout << "You owe " << tax << " drachmas in tax." << endl;

}