Oct 15, 2020 at 2:50am UTC
A business needs to calculate the bonus points for sales representatives. The bonus points are based on how much each sales representative sold the year.
Write a program to prompt the user to enter the sales amount for a sales representative. Include different functions for each group of Sales representatives.
Display the bonus points as integers.
Please see the table showing the Groups, Sales, and Bonus points:
Groups Sales Bonus points
A $0 - $100, 000 500 points
$100, 001 - $1,000,000 1, 500 points
B $1,000,001 - $2,000, 000 2,000 points
$2,000,001 - $3,000, 000 2, 500 points
C $3,000,001 - $4,000, 000 3, 000 points
$4,000,001 and over 5, 000 points
Input Validation: Do not accept negative numbers for sales.
Oct 15, 2020 at 2:52am UTC
where are you stuck? We need more than a copy of the assignment, we need your code and what part you don't understand.
Oct 15, 2020 at 3:08am UTC
So far I have this:
using namespace std;
float salesamounts; (sales made)
int username; (Sales rep name)
cout << “Please enter your sales made for the year: $”
cin >> salesamounts;
count << endl;
// exception on program
if (salesamounts <= -1);
if (salesamounts <= -1);
cout << “Value cannot be negative. Please input again.”
// Group A placement
for (;salesamount <= 100000;)
if ((salesamounts <= 100000)
cout << “Congratulations! You earned 500 Bonus Points!”
for (; salesamounts > 100001 < 1000000;)
if ((salesamounts > 100001 < 1000000));
cout << “Congrats! 10000 Bonus Points have been credited to you!”
The problem I’m having is that when I debug it, it all runs at once with no respect to the restraints what so ever. I don’t know what’s wrong or what’s right.
Oct 15, 2020 at 4:20am UTC
So what happened when you ran it to make you think something is wrong?
Oct 15, 2020 at 4:32am UTC
When I ran it in MS Visual Studio, the line to input ran correctly but the output was everything in the code, including the restriction on the negative value.
It would look something like:
“Enter value: $1
Please enter value again. Congratulations! 500 Bonus Points! Congrats! You’ve been awarded 10000 bonus points!
Code ran successfully. Please press any key to exit.”
Oct 15, 2020 at 4:43am UTC
Maybe you should post the code you can run instead of the stuff you've posted above because it is incomplete and littered with errors with absolutely no chance of running let alone the messages you had.
Oct 15, 2020 at 1:27pm UTC
1. Don't put semi-colons after your if statement.
2. ((salesamounts > 100001 < 1000000)); makes no sense.
Did you mean,
(salesamount > 100001 && salesamount < 1000000)