daily pastebin goal
41%
SHARE
TWEET

Untitled

a guest Jun 13th, 2018 42 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top