# 02. Annual Salary

a guest
May 3rd, 2018
95
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. #include <iostream>
2. #include <iomanip>
3.
4. using namespace std;
5. int main() {
6.   int years; string prof;
7.   double money;
8.   cin>>years; cin.ignore();
9.   getline(cin,prof);
10.   string out = "Total earned money: ";
11.   if(prof[0]=='C'&&years<=5) {money=(double)54.0*34.2;}
12.   if(prof[0]=='J'&&years<=5) {money=(double)57.0*34.2;}
13.   if(prof[0]=='C'&&years>5) {money=(double)5400.0;}
14.   if(prof[0]=='J'&&years>5) {money=(double)5700.0;}
15.   if(prof[0]=='F'&&years<=5) {money=(double)41.0*34.2;}
16.   if(prof[0]=='U'&&years<=5) {money=(double)31.0*34.2;}
17.   if(prof[0]=='F'&&years>5) {money=(double)4100.0;}
18.   if(prof[0]=='U'&&years>5) {money=(double)3100.0;}
19.   if(prof[0]=='G'&&years<=5) {money=(double)36.0*34.2;}
20.   if(prof[0]=='G'&&years>5) {money=(double)3600.0;}
21.   cout<<out; cout<<fixed<<setprecision(2)<<money*12.0<<" BGN"<<endl;
22.   return false;
23. }
RAW Paste Data