Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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 $10,000, he or she receives a 6% commission 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

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

Systems Analysis And Synthesis Bridging Computer Science And Information Technology

Authors: Barry Dwyer

1st Edition

0128054492, 9780128054499

More Books

Students also viewed these Databases questions