question archive The following pseudocode algorithm has an error
Subject:Computer SciencePrice:2.89 Bought3
The following pseudocode algorithm has an error. The program is supposed to ask the user for the length and width of a rectangular room, and then display the room's area. The program must multiply the width by the length to determine the area. The order is not correct. Find the error and rewrite a corrected version.
area = width x length.
Display "What is the room's width?"
Input width.
Display "What is the room's length?"
Input length.
Display area.
The problem is that it multiplied width and length first, before it even asked the user what the length and width is. Here's the correct order:
display "what is the room's width?"
input width.
display "what is the room's length?".
input length.
area= width x length
display area.