# Thread: I need some help writing and equation please.

1. ## I need some help writing and equation please.

Hello all, hoping if any of you can help me out... I am stumped.

The question is this:

Weekly pay must be computed for a number of employees at the ABC Looping Company, however not all employees are hourly employees. There are three types of employees: hourly, salaried and commissioned employees. Hourly employees receive an hourly wage; salaried employees have a yearly salary and commissioned employees receive a base weekly salary of 200.00 + a commission which is based on their weekly sales according to the chart below.

Less than $1000.00 - 3 % of weekly sales$1000 – $5000.00 - 3% of the amount below 1000.00 + 5% of the 1000.00 and above Greater than$5000.00 - +6% of the sales amount

*** This seems very simple, the 'less than 1000' and 'greater than 5000' are simple ( < 1000 and > 5000) I can't seem to write an equation for the middle one!

EG. Lets say they made $4500 in sales that week. well then it would be .03 * 1000 but then there is$3500 @ .05

How can I write that so 'whatever I plug in' is outputted... I hope I am explaining this right. This is for my Computer Science class btw.

*EDIT* - Hopefully this will help more, below is the program I am writing, the part circled in green is where I am loss: