dart-tax-console-test/main.dart
2020-09-10 10:12:35 +07:00

42 lines
1.0 KiB
Dart

import 'dart:io';
String input(String message ){
stdout.write(message);
return stdin.readLineSync();
}
void main() {
var salary = double.parse( input("Enter Salary : ")) ;
var bonus = double.parse(input("Enter Bonus : "));
var spouse = double.parse(input("Enter Spouse : "));
var children = double.parse(input("Enter Children : "));
print("--------------------------------------------------------");
var familyCount = spouse + children;
var familyCost = familyCount * 150000;
print("family : ${familyCount} * 150000 = ${familyCost}");
var noFamilySalary = salary - familyCost;
print("salary = ${salary} - ${familyCost} = ${noFamilySalary}");
var tax1 = noFamilySalary * 0.1 -160000;
print("Tax 1 = ${noFamilySalary} * 0.1 - 160000 = ${tax1}");
var tax2 = bonus * 0.2 ;
print("Tax 2 = ${bonus} * 0.2 = ${tax2}");
var taxSum = tax1 + tax2;
print("Tax = ${tax1} + ${tax2} = ${taxSum}");
var lastSalary = salary + bonus - taxSum;
print("Last Salary = ${salary} + ${bonus} - ${taxSum} = ${lastSalary}");
}