Guest User

Untitled

a guest
Jun 13th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. // To execute C++, please define "int main()"
  6. int main() {
  7.  
  8. unsigned long int tax;
  9.  
  10. unsigned long int amt = 0;
  11.  
  12. cout << "Enter the amount to be taxed:\n";
  13. cin >> tax;
  14.  
  15. if( tax <= 100000 ){
  16. cout << "No tax to be payed!";
  17. }
  18. else{
  19.  
  20. tax -= 100000;
  21.  
  22. if(tax > 100000){
  23.  
  24. amt += 100000*20/100;
  25.  
  26. tax -= 100000;
  27.  
  28. if(tax >= 300000){
  29. amt += 300000 * 30 / 100;
  30.  
  31. tax -= 300000;
  32.  
  33. amt += tax * 50 / 100;
  34. }
  35.  
  36. else {
  37. amt += tax * 30 / 100;
  38. }
  39.  
  40. }
  41.  
  42. else{
  43. amt += tax * 20 / 100;
  44. }
  45.  
  46. cout << "Tax to be payed: " << amt;
  47.  
  48. }
  49.  
  50.  
  51. }
Add Comment
Please, Sign In to add comment