Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

In C++, please!

image text in transcribed

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 less 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 Enter the value for revenue: Invalid input. //test case 3 - invalid input -1000

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

Graph Databases New Opportunities For Connected Data

Authors: Ian Robinson, Jim Webber, Emil Eifrem

2nd Edition

1491930896, 978-1491930892

More Books

Students also viewed these Databases questions