Answer to Question #174280 in C++ for hari

Question #174280

Write a C++ program that will input an employee's monthly sales and calculate the gross pay, deductions, and net pay


1
Expert's answer
2021-03-22T05:57:04-0400
#include <iostream>
using namespace std;
int main()
{
float MonthlySales,Commission,GrossPay,Deductions,NetPay;
float const BasePay =1000; //declaring BasePay as const set to 1000
cout<<"Enter your mothly sales : ";
cin >>MonthlySales;
  
if(MonthlySales >= 50000)
Commission = MonthlySales * 0.16; //conditions
else if(MonthlySales < 50000 && MonthlySales >= 40000)
Commission = MonthlySales *0.12;
else if(MonthlySales < 40000 && MonthlySales >= 30000)
Commission = MonthlySales *0.10;
else if(MonthlySales < 30000 && MonthlySales >= 10000)
Commission = MonthlySales *0.06;
else if(MonthlySales < 10000)
Commission = MonthlySales *0.03;

GrossPay = BasePay + Commission;
  
Deductions = GrossPay*0.18;
  
NetPay = GrossPay - Deductions;
  
cout << "\nBase Pay : $"<<BasePay<<endl; //displaying the output
cout << "Commission : $"<<Commission<<endl;
cout << "Gross Pay : $"<<GrossPay<<endl;
cout << "Deductions : $"<<Deductions<<endl;
cout << "Net Pay : $"<<NetPay;
}

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