Ask Question
7 August, 16:04

The following pseudocode algorithm with 6 steps has an error. It is supposed to use values input for a rectangular room's length and width to calculate and display its area. Find the error and explain in writing how you would fix this algorithm. You can write your answers to a word document names lab1-yourname. doc for submission. 1) area = width * length. 2) Display to the user "What is the room's width?". 3) Input width. 4) Display to the user "What is the room's length?". 5) Input length. 6) Display area.

+4
Answers (1)
  1. 7 August, 16:20
    0
    Correct algorithm is here.

    1) Display to the user "What is the room's width?".

    2) Input width.

    3) Display to the user "What is the room's length?".

    4) Input length.

    5) area = width * length.

    6) Display area.

    Explanation:

    The algorithm given in the question is wrong because we can not perform any operation on the variable before taking their value. It will give error.

    According to the question, it will calculate area first then it will take input value of length and width. But we have to take input length and width first then we can find the area.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “The following pseudocode algorithm with 6 steps has an error. It is supposed to use values input for a rectangular room's length and width ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers