So I'm trying to make a program that calculates the hours and pay for the number of shifts you worked but I'm having trouble with it not adding the hours that are put in properly and I'm wondering how to make it apply breaks for every shift separately and not to the total. Pretty much what I'm trying to do is:
Input amount of shifts (lets say 3)
Start of the shift (lets say 12)
End of the shift (lets say 20)
The total hours worked (which would be 8)
Then I want it to make it ask me the same thing the amount of times I put in "shifts" which would be 3 in this case. And while displaying the hours per shift I want it to total my hours as well and display that.
Then subtract the breaks from the individual hours and add the results together in an Actual hour variable. Then that goes on to be multiplied by wage.
So far I've gotten to this. Bare in mind I'm SUPER new to programming so when explaining pretend like I'm 5.
Your breakTime isnt initialised ,and is gonna be if the 8>= hours >= 4 ,what if the employe works more or less than that? if the variable does bot assinged well It will takes 0 or a random value the calculation would be wrong ,so initial it or assign some appropriate values to it , same for wageTotal and hrTotal