Answered step by step
Verified Expert Solution
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
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 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 fromStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started