Ask Question
3 January, 21:50

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.

+3
Answers (1)
  1. 3 January, 23:17
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers