Answer to Question #272992 in C++ for Tuturi

Question #272992

 Company ABC in Kenya pays its employees based on a commission of the sales they make as 

illustrated in the table below:

Monthly Sales Commission Rate

First 50,000 10%

Next 100,000 15%

Next 200,000 20%

Above 350,000 25%

Additionally, all employees are entitled to a basic commission of 20,000 per month.

a. Draw a flowchart that allows a HR employee to input an employee’s monthly sales, 

computes the commission due to the employee and displays it to the HR employee.

[7 Marks]

b. Write a C++ program implementation of the flowchart above. [8 Marks]


1
Expert's answer
2021-11-29T00:00:03-0500
#include <iostream>


using namespace std;


int main()
{
    double sales, tax, ttax;
    cout << "Enter Employee monthly sales" << endl;
    cin >> sales;
    if (sales >= 50000)
    {
        tax = 0.1 * sales;
    }
    if (sales > 50000 && sales <= 150000)
    {
        tax = 0.15 * sales;
    }
    if (sales > 15000 && sales <= 350000)
    {
        tax = 0.20 * sales;
    }
    if (sales > 350000)
    {
        tax = 0.25 * sales;
    }
    ttax = tax + 20000;
    cout << "The total tax is: " << ttax << endl;
    return 0;
}

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