need help with if-else statement

I working on a project where you have to write in a input for a worker at an amusment park and then calculate the wages for the worker.

This is what I have so far:

1
2
3
4
5
6
7
8
9
10
11
void locations()
{
	int location, hour, money, total, paid;

	if(location == 100 && location == 199)
		total = (10.00 



}
    


and this is what is asking me to do:
Locations 100-199 get paid $10.00 per hour with time and a half for any hours over 5 per day.
Locations 200-299 get paid $7.50 per hour with double time for hours worked over 6 per day.
Locations 300-399 get paid $9.25 for the first 4 hours and $10.50 for the rest.
Locations 400-499 get paid $13.50 per hour on Sundays (day 1) and Saturdays (day 7) and $6.75 per hour
otherwise.
Locations 500-599 get paid $8.00 per hour for the first 6 hours per day and $12.00 per hour after that.


I don't really understand if anyone can help me on this
thanks
Is location just going to be 100 or 199 for example, or could it be any number within that range?

get location number from user
get total hours from user

if location between 100 and 199
--if hours greater than total allowed before overtime kicks in
----set overtime hours
---regular pay is regular hours times regular pay rate
---overtime pay is overtime pay is ot hours times ot pay rate
---total pay is the sum of regular and overtime
else if other conditions
---variations on above
return total pay


The number 100 to 199 is in the range of the the two numbers and I'm still not understanding what your trying to say
Locations 100-199 get paid $10.00 per hour with time and a half for any hours over 5 per day.


Lets take this as an example:
first set workers array from 0 to size num of workers, assign each worker position in array;

loop through array and if worker[position]==loop[i]:
if location greater or equal to 100 and less or equal to 199:
if(hour<=5)
pay=10;
hours worked;
else
payOverFive=5;
extraHourWorked;
sum=pay*hourWorked+payOverFive*extraHourWorked;

//do like this to the rest? btw set variables appropriately and if you have number of workers, you will use loop i assume.

Last edited on
thanks yours makes a bit more sense of what im trying to write
thanks.
loop through array and if worker[position]==loop[i]:
if location greater or equal to 100 and less or equal to 199:
if(hour<=5)
pay=10;
hours worked;
else
payOverFive=5;
extraHourWorked;
sum=pay*hourWorked+payOverFive*extraHourWorked;


but that's stuff that you told me kind of is confusing me.
like how is that expose to be written out??
(csstudent123)
Topic archived. No new replies allowed.