#include <iostream>
using namespace std;
int main(){
cout<<"Enter rank\n";
string rank;
cin>>rank;
cout<<"Enter name\n";
string name;
cin>>name;
double gross;
if(rank=="Sargent"){
gross = 2500 - (0.027 * 2500);
}
else if(rank=="Major"){
gross = 4800 - (0.048 * 4800);
}
else if(rank=="Captain"){
gross = 6800 - (0.068 * 6800);
}
cout<<"Name: "<<name<<"\nNet Salary: "<<gross<<endl;
}
Comments
Leave a comment