Answer to Question #247533 in C++ for Eric

Question #247533
The Ghana Navy has been paying its newly employed staff on ‘table-top’, a practice that has attracted much criticism from the military command. On a trial basis they have engaged your services to design a payment system with the following functionalities.
1
Expert's answer
2021-10-07T03:05:07-0400
#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;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS