Question: Unit 3 Debugging Exercises Part 1 The following 2 debugging assignments begins with some comments (lines that begin with 2 slashes) that describes the program.



Unit 3 Debugging Exercises Part 1 The following 2 debugging assignments begins with some comments (lines that begin with 2 slashes) that describes the program. Examine the pseudocode that follows the introductory comments. Discover the errors and fix the pseudocode in the area labeled, Correct the pseudocode below. Pseudocode Debugging Exercise 1 // This pseudocode is intended to display employee net pay values. // All employees have a standard $45 deduction from their checks. // if an employee does not earn enough to cover the deduction, an error message is displayed. start Declarations string name num hours num rate string DEDUCTION = 45 string EOFNAME = "ZZZ" num gross num net output "Enter first name or, EOFNAME," to quit" input name if name not equal to EOFNAME output "Enter hours worked for", name Styles output "Enter first name or ", EOFNAME," to quit" input name if name not equal to EOFNAME output "Enter hours worked for", name input hour's output "Enter hourly rate for ", name input rate gross = hours * rate net = gross - DEDUCTION while net > then output "Net pay for ", name,"is", net else output "Deductions not covered. Net is 0." endwhile output "Enter next name or ", EOFNAME," to quit" input name endir output "End of job" stop Pseudocode Debugging Exercise 2 Styles // This pseudocode is intended to display employee net pay values. // All employees have a standard $45 deduction from their checks. // if an employee does not earn enough to cover the deduction, an error message is displayed. // This example is modularized. start Declarations string name string EOFNAME = 7777 num hours num rate num DEDUCTION = 45 num net while name not equal to EOFNAME housekeeping() endwhile while name not equal to EOFNAME mainloop() endwhile while name not equal to EOFNAME finish() endwhile stop housekeepingo) output "Enter first name on EOFNAME to quit return mainloon Paragraph Sly . mainloop) output "Enter hours worked for name input hours output "Enter Hourly rate for", name input rate gross = hours * rate net = gross - DEDUCTION if net > then output "Net pay for ", name,"is", net else output "Deductions not covered. Net is 0." endir output "Enter next name or ", EOFNAME," to quit" input name return finish() output "End of job" return Unit 3 Debugging Emer
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
