Homework

drakehamilton
Desk check the following pseudocode, for the input given below. Note: FOR loop used in the pseudo code. In the table, use the statement numbers shown instead of entering the statement to indicate which statement is executed. 

 1 BEGIN  
 2 x = 1       
 3 FOR (x=1;x<=2;x++)
 4 cost = 50
 5 INPUT usage
 6 IF (usage > 100) THEN
 7 cost = 100
 8 ELSE
 9 INPUT cType
10 IF (cType == "Poor") THEN
11 cost = usage * cost * 0.1
12 ENDIF
13 ENDIF
14 DISPLAY "The cost is $" + cost
15 ENDFOR
16 END

Fill in the missing column headings and necessary cells when carrying out a desk check of the above pseudocode with the input value for usage = 100 and cType = “Poor” in the first iteration of the loop and with input value for usage = 10 and cType = “Rich” in the second iteration
Please note: The number of rows is not an indication of the length of the answer required.

Statement number
x



Condition
Output

2
1






3




True





































































































































    • 6 years ago
    • 4
    Answer(1)

    Purchase the answer to view it

    • question41.docx