Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In C++ You are a distributor for one of the leading pharmaceutical companies. You want to calculate the amount of commission you will get based

image text in transcribedIn C++

You are a distributor for one of the leading pharmaceutical companies. You want to calculate the amount of commission you will get based on the revenue of the company. Write a program that takes revenue (in USD) as the input and prints the commission you earned, based on the following criteria. The revenue must be of type double. If the revenue is lesser than or equal to $50000, then the commission is 10% of the revenue. If the revenue is greater than $50000, then the commission is the sum of 10% commission for the amount $50000 and 20% commission for the remaining amount (revenue - 50000). Make sure your program validates user input. If revenue is a negative value then the commission computation will yield a negative value. Instead of printing a negative value, print "Invalid input." Note: The commission should be formatted with a two-digit precision as shown below. You can use the setprecision() function with the fixed manipulator from library to do so. For example: Test Input Result //test case 1 - revenue50K 80000 Enter the value for revenue: The commission that you earn is $11000.00 //test case 3 invalid input -1000 Enter the value for revenue: Invalid input

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_2

Step: 3

blur-text-image_3

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

PC Magazine Guide To Client Server Databases

Authors: Joe Salemi

1st Edition

156276070X, 978-1562760700

More Books

Students also viewed these Databases questions

Question

Describe several ways to identify high-potential employees.

Answered: 1 week ago

Question

Write a note on Organisation manuals

Answered: 1 week ago

Question

Define Scientific Management

Answered: 1 week ago

Question

Explain budgetary Control

Answered: 1 week ago

Question

Solve the integral:

Answered: 1 week ago