A landscape designer writes an algorithm to determine whether a trapezoidal flower bed has a "Standard Area" based on its parallel sides aaa and bbb, and its perpendicular height hhh.
If the area of the flower bed is between 120 and 250 inclusive, "Standard Area" is output.
If the area is not between 120 and 250 inclusive, "Custom Area" is output.
01 a = input("Enter side a")
02 b = input("Enter side b")
03 h = input("Enter height")
04 area = 0.5 * a + b * h
05 if area >= 120 then
06 print("Standard Area")
07 else
08 print("Custom Area")
09 endif
The algorithm does not work correctly.
Identify the line numbers of the two logic errors in the algorithm and write the corrected code for each line.
Practise OCR GCSE Computer Science Designing, creating and refining algorithms with exam-style questions for GCSE Computer Science. 50 questions, matched to the OCR GCSE Computer Science (J277) specification and written in Component 01 and Component 02 style. Every question includes a full worked solution and mark scheme, so you can see where marks are awarded rather than just whether you got the answer right.