Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

write in c++ You are a distributor for one of the leading pharmaceutical companies. You want to calculate the amount of commission you will get

write in c++ 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 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 clomanip> library to do so. For example: Test Input Result W/test case 1 - revenuec 50K 10000 Enter the value for revenue: The commission that you earn is $1000.00 V/test case 2 - revenue>50K 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

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

Oracle Database Administration The Essential Reference

Authors: Brian Laskey, David Kreines

1st Edition

1565925165, 978-1565925168

More Books

Students also viewed these Databases questions

Question

2. Why?

Answered: 1 week ago

Question

1. Where do these biases come from?

Answered: 1 week ago