Ask Question
2 June, 13:07

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.

+1
Answers (1)
  1. 2 June, 14:14
    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?
Get 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 there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers