alaminrifat

URI -1048 with C++

Apr 13th, 2020
290
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.23 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6.     float s,perc,t;
  7.     cin>>s;
  8.     cout.precision(2);
  9.     if(s >= 0 && s <= 400.00)
  10.     {
  11.         perc = s*0.15;
  12.         cout<<"Novo salario: "<<fixed<<s+perc<<endl;
  13.         cout<<"Reajuste ganho: "<<fixed<<perc<<endl;
  14.         cout<<"Em percentual: 15 %"<<endl;
  15.     }
  16.     else if(s >= 400.01 && s <= 800.00)
  17.     {
  18.         perc = s*0.12;
  19.         cout<<"Novo salario: "<<fixed<<s+perc<<endl;
  20.         cout<<"Reajuste ganho: "<<fixed<<perc<<endl;
  21.         cout<<"Em percentual: 12 %"<<endl;
  22.     }
  23.     else if(s >= 800.01 && s <= 1200.00)
  24.     {
  25.         perc = s*0.10;
  26.         cout<<"Novo salario: "<<fixed<<s+perc<<endl;
  27.         cout<<"Reajuste ganho: "<<fixed<<perc<<endl;
  28.         cout<<"Em percentual: 10 %"<<endl;
  29.     }
  30.     else if(s >= 1200.01 && s <= 2000.00)
  31.     {
  32.         perc = s*0.07;
  33.         cout<<"Novo salario: "<<fixed<<s+perc<<endl;
  34.         cout<<"Reajuste ganho: "<<fixed<<perc<<endl;
  35.         cout<<"Em percentual: 7 %"<<endl;
  36.     }
  37.     else if(s >= 2000.01 )
  38.     {
  39.         perc = s*0.04;
  40.         cout<<"Novo salario: "<<fixed<<s+perc<<endl;
  41.         cout<<"Reajuste ganho: "<<fixed<<perc<<endl;
  42.         cout<<"Em percentual: 4 %"<<endl;
  43.     }
  44.  
  45. }
Advertisement
Add Comment
Please, Sign In to add comment