Write an algorithm and create a flowchart to solve the following problem. Ask th
ID: 2247081 • Letter: W
Question
Write an algorithm and create a flowchart to solve the following problem. Ask the user to input 5 numbers. Find the average, highest value and lowest value and display these numbers to the user.
Part 2: The following pseudocode algorithm has an error. The program should ask the user for the length and width of a rectangular room and display the room's area. Find the error and rewrite the algorithm correctly.
Area = length*width
Display "What is the room's width? "
Input width
Display "What is the room's length?"
Input length
Display area
PreviousNext
Explanation / Answer
( Hope You are aware of Conditional operator ( ? :) )
Pseudocode:
Let 5 Integers be A,B,C,D,E
Intialize AVG,HIGH,LOW
Intialize Temp1,Temp2,Temp3,Temp4,Temp5,Temp6
AVG=( A+ B+ C+ D+ E) / 5
Temp1 = A<B ? A : B
Temp2 = C<D ? C : D
Temp3 = Temp1 < Temp2 ? Temp1 : Temp2
LOW = Temp3 < E ? Temp3 : E
Temp4 = A>B ? A : B
Temp5 = C>D ? C : D
Temp6 = Temp4 < Temp5 ? Temp4 : Temp5
HIGH = Temp6 < E ? Temp3 : E
Display AVG
Display LOW
Display HIGH
---------------------------------------------------------------------------------------------------------------------------------------------------------
Order of the statements important here
Pseudocode:
Display "What is the room's width? "
Input width
Display "What is the room's length?"
Input length
Area = length*width
Display Area
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.