Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please use iostream if and while statement to solve this question thanks Description A salesperson also receives a bonus at the end of each month,

image text in transcribedplease use iostream if and while statement to solve this question thanks
image text in transcribed
image text in transcribed
Description A salesperson also receives a bonus at the end of each month, based on the following criteria: If the salesperson has been with the store for five years or less, the bonus is $10 for each year that he or she has worked there. If the salesperson has been with the store for more than five years, the bonus is $20 for each year that he or she has worked there. The salesperson can earn an additional bonus as follows: If the total sales made by the salesperson for the month are at least $5.000 but less than $10,000, he or she receives a 3% commission on the sale. If the total sales made by the salesperson for the month are at least S10,000, he or she receives a 6% conmission on the sale. Prompt and read the monthly salary of the salesperson (double), the number of years he or she has worked (int), and total sales made (double). Your output will be the base salary, the bonus, and the total salary Specifications Comment all your variables and parts of code that perform calculations, input, and output, etc Give your variables meaningful names Variables must be declared with the correct type . Use constants in your program rather than use literals Your program needs to terminate if input is not a valid number or if the amount entered is negative (or if the salary is too high, greater than ot equal to $1,500.00) All decimals need to formatted to two decimal places and all the output must be nicely aligned, refer to the sample output Only output the bonus and the total after bonuses if some bonus can added to the salary, refer to the sample output Sample Output Jimis -MacBook Pro : Asst04 VaskoDaGamer g Assignment04.cpp Jimis -MacBook - Pro: Asst04 VaskoDaGamer$ ./a.out Enter years worked 6 Enter monthly salary: 1200.00 Enter sales amount: 6500.54 Montly earnings Years r ked Base aalary...$1200.00 Bonus Anount sold....$ 6500.54 Salary / bonus Jisis-MacBook-Pro :Asst04 VaskoDaGaerS 315.02 $ 1515.02 ./a. out Eater years worked: 11 Enter monthlysalar: 1345.67 Enter sales asount: 345. 61 Montly earnings Years worked Base salary..$ 1345.67 Bonus 220.00 345.61 $ 1565.67 Salary /bonus Jinis-MacBook-Pro: Asst04 VaskoDaGasers/a. out Enter years worked: 3 Enter sales amount: 13567.11 Montly earnings Years worked Bonus 844.03 Salary bonus Jinis-MacBook-Pro:Asst04 VaskoDaGasers /a. out $1955.14 Enter years worked: o Enter monthly salary: 750.00 Enter sales a0unt: 250.23 Montly earnings Years rked Base salary...-.... Anount sold Jimis-MacBook-Pro:Asst04 VaskoDaGaner$ /a.out 50.00 250.23 Enter years orked: 0 Enter monthly salary:750.00 Enter sales a ount: 9999.99 Montly earnings Years rked Base salary....-$750.00

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

Students also viewed these Databases questions

Question

Identify three types of physicians and their roles in health care.

Answered: 1 week ago

Question

Compare the types of managed care organizations (MCOs).

Answered: 1 week ago