How to create a work algorithm for the following problem? Attached is the problem and my solution below.
Steve works a minimum of 0 hours and a maximum of 12 hours only on Mondays, Wednesdays and Fridays.
Steve works for a fixed rate of $10 per hour for the first 10 hours of the wek, $15 per hour for the second 10 hours of
the week, $20 per hour for the third 10 hours of the week and $25 per hour for the last 6 hours of the week.
Steve receives a bonus of $50 whenever he works for more than 10 hours on exactly 1 day only. Steve receives a
bonus of $75 whenever he works for more than 10 hours on exactly 2 days only. Steve receives a bonus of $100
whenever he works for more than 10 hours on all 3 days.
Write a pseudo code algorithm entitled STEVE_WAGE_CALCULATOR that reads in three integers between 0 and 12
inclusive that represent the hours worked on Monday, Wednesday and Friday of a given week and prints Steve’s total
salary for that week after all adjustments
program STEVE_WAGE_CALCULATOR
begin
mhoursWorked <- 0
whoursWorked <- 0
fhoursWorked <- 0
weeklyHours
bonus1 <- 50
bonus2 <- 75
bonus3 <- 100
mBonus <- 0
mNormal <-0
wBonus <-0
wNormal <-0
fBonus <-0
fNormal <-0
total <-0
PRINT "Enter number of hours worked on Monday: "
READ_INT mhoursWorked
PRINT "Enter number of hours worked on Wednesday: "
READ_INT whoursWorked
PRINT "Enter number of hours worked on Friday: "
READ_INT fhoursWorked
If mhoursWorked = 10
then mhoursWorked * 10 + bonus1
READ_INT mBonus
else mhoursWorked * 10
READ_INT mNormal
if whoursWorked = 10
then whoursWorked * 15 + bonus2
READ_INT wBonus
else whoursWorked * 15
READ_INT wNormal
if fhoursWorked = 10
then fhoursWorked * 20 + bonus3
READ_INT fBonus
else fhoursWorked * 20
READ_INT fNormal
if mBonus && wBonus && fBonus = true
then mBonus + wBonus + fBonus = total
else if mBonus && wBonus && fNormal = true
then mBonus + wBonus + fNormal = total
else if mBonus && wNormal && fNormal = true
then mBonus + wNormal + fNormal = total
else if mNormal && wNormal && fNormal = true
then mNormal + wNormal + fNormal = total
else if mNormal && wNormal && fBonus = true
then mNormal + wNormal + fBonus = total
else mNormal && wBonus && fNormal = true
then mNormal + wBonus + fNormal = total
PRINT "Total Weekly Wage: " + total
end