
Patrick B. answered 11/08/20
Math and computer tutor/teacher
This problem is solved and closed pending further clarifications and program specs...
the code block is only a PARTIAL solution..
Kristina, please REPOST with the answer to the 3 questions below.. the more DETAILS
the better
=============================================
The first line of this table is unclear to me...
what is meant by the statement:
overtime - (2/3)*absent
and how does that figure into the calculation of the bonus?
are 2 inputs required: one for the total hours worked and another for the hours absent?
then that result is used to calculate the bonus...
for now, here is a python function that returns the bonus per the rest of the table..
Because the design is unclear, the flowchart and algorithm is nearly impossible and
the complete source code is out of the question..
clarify what is meant by the first row of the table, so I can be of more help...
Here's the best I can do for you now:
#=====================================================
def bonus_paid(hours):
iReturn=0
if hours>=40:
iReturn=50
elif hours>=30 and hours<40:
iReturn=40
elif hours>=20 and hours<30:
iReturn=30
elif hours>=10 and hours<20:
iReturn=20
else:
iReturn=10
return(iReturn)
#change the number passed to bonus_pad() to test
bonusAmt = bonus_paid(45)
print(bonusAmt)
Kristina S.
I was going to put input("") then just type in the numbers from the bonus paid, but i wasn't sure. Thanks for your help11/08/20

Patrick B.
more questions ,making it WORSE instead of clarification.. average of what? input("") does nothing..... take the code I have given and find out exactly what this program is supposed to do, or else no more progress can be made (1) WHAT EXACTLY is the data that is to be input (2) What calculations are to be done with the input to arrive at the correct result and how does that relate to the table shown? what formulas or averages are needed to arrive at the solution? (3) how are the results to be displayed11/08/20
Kristina S.
I'm not sure tbh. I was going to add input("") to my coding then just type the numbers from the bonus paid, but I wasn't sure. I also saw an algorithm example in which they took the average of it, but I don't think this one requires it11/08/20