Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- using namespace std;
- int main() {
- int years; string prof;
- double money;
- cin>>years; cin.ignore();
- getline(cin,prof);
- string out = "Total earned money: ";
- if(prof[0]=='C'&&years<=5) {money=(double)54.0*34.2;}
- if(prof[0]=='J'&&years<=5) {money=(double)57.0*34.2;}
- if(prof[0]=='C'&&years>5) {money=(double)5400.0;}
- if(prof[0]=='J'&&years>5) {money=(double)5700.0;}
- if(prof[0]=='F'&&years<=5) {money=(double)41.0*34.2;}
- if(prof[0]=='U'&&years<=5) {money=(double)31.0*34.2;}
- if(prof[0]=='F'&&years>5) {money=(double)4100.0;}
- if(prof[0]=='U'&&years>5) {money=(double)3100.0;}
- if(prof[0]=='G'&&years<=5) {money=(double)36.0*34.2;}
- if(prof[0]=='G'&&years>5) {money=(double)3600.0;}
- cout<<out; cout<<fixed<<setprecision(2)<<money*12.0<<" BGN"<<endl;
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement