Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

c++ class problem Topics if/else if Description Write a program that calculates a sales persons monthly commission. The program asks the user to enter the

c++ class problem

Topics

if/else if

Description

Write a program that calculates a sales persons monthly commission. The program asks the user to enter the total sales amount for the month. It calculates the commission on the basis of the sales amount. Then, it displays a report including the sales amount and the commission earned. The commission is computed using the following:

15% commission for the first $2,000.00 sales

20% commission for the next $1,000.00 sales

25% commission for the next $500.00 sales

30% commission for the next $500.00 sales

35% commission for the remaining sales

Requirements

Use the if/else if statement (not multiple if statements)

Test Data

Test the assignment by performing the following test runs with the test data shown:

Input Test Run 1

Enter Sales Amount: 1500.00

Output Test Run 1

Sales Amount: 1500.00

Commission Earned: 225.00

Input Test Run 2

Enter Sales Amount: 2500.00

Output Test Run 2

Sales Amount: 2500.00

Commission Earned: 400.00

Input Test Run 3

Enter Sales Amount: 3500.00

Output Test Run 3

Sales Amount: 3500.00

Commission Earned: 625.00

Input Test Run 4

Enter Sales Amount: 4000.00

Output Test Run 4

Sales Amount: 4000.00

Commission Earned: 775.00

Input Test Run 4

Enter Sales Amount: 4500.00

Output Test Run 4

Sales Amount: 4500.00

Commission Earned: 950.00

Submit

Copy the following in a file and submit that file:

Outputs from test runs

All the C/C++ source code

Sample Code

/*

The code below shows only a part of an if /else if statement that calculates the commission amount from the sales amount. The if/else if statement below needs to be completed by adding additional if else components. In the statement below, the variable sales contains the sales amount and the variable commission the commission amount. Both the sales and commission are variables of type double.

*/

if (sales =>

{

commission = .15 * sales;

}

else if (sales =>

{

commission = (.15 * 2000.00) + ( (sales 2000.00) * .20 );

}

else if (sales =>

{

commission = (.15 * 2000.00) + (.20 * 1000.00) + ( (sales 3000.00) * .25 ) ;

}

.

.

.

else

{

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Design Operation And Evaluation Of Mobile Communications

Authors: Gavriel Salvendy ,June Wei

1st Edition

3030770249, 978-3030770242

More Books

Students also viewed these Programming questions

Question

4. Greet students at the door to the class every day.

Answered: 1 week ago

Question

49. Prove that E[X2] (E[X])2. When do we have equality?

Answered: 1 week ago