Answer to Question #187030 in Microeconomics for Suchita

Question #187030

Find the Error 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 in order to determine the area. Find the error. area = width times length. Display "What is the room's width?". Input width. Display "What is the room's length?". Input length. Display area.


1
Expert's answer
2021-04-30T10:31:23-0400

The calculation for area is done before the values are entered.

For calculating area of a rectangular room, the value of area = width × length

It must be set after taking length and width input and before displaying area.

The correct pseudocode will appear like

Display "What is the room's width?"

Input width

Display "what is the room's length?"

Input length

Area = width × length

Display area


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS