Question
Rewrite the highlighted section to correct the errors in the placement of the methods. Hint: Read the implementation (detail steps) for each method to help
Rewrite the highlighted section to correct the errors in the placement of the methods.
Hint: Read the implementation (detail steps) for each method to help you determine which methods should not be within the while statement and the correct placement of the misplaced modules.
start
Declarations
string name
string EOFNAME = "ZZZZ"
while name not equal to EOFNAME
housekeeping()
mainLoop()
finish()
endwhile
stop
housekeeping()
output "Enter first name or ", EOFNAME, " to quit "
input name
return
mainLoop()
Declarations
num hours
num rate
num DEDUCTION = 45
num gross
num net
output "Enter hours worked for ", name
input hours
output "Enter hourly rate for ", name
input rate
gross = hours * rate
net = gross - DEDUCTION
if net > 0 then
output "Net pay for ", name, " is ", net
else
output "Deductions not covered. Net is 0."
endif
output "Enter next name or ", EOFNAME, " to quit "
input name
return
finish()
output "End of job"
return
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started