In: Computer Science
develop pesudocode and draw flow chart for :
the area of a triangle when the height h takes value between 0.5 and 3. the area of triangle is A=h(base/2)
Solution for the problem is provided below, please comment if any doubts:
Pseudo Code:
Begin
Numeric A, base, h
Display(‘Enter the base’)
base=input()
Display(‘Enter the value of h (between 0.5 and 3)’)
h = input()
if(h > 0.5 AND h<3)
//compute area
A=h*(base/2)
Display(A)
Else
//display error
Display(‘Invalid value of h’)
End
Flow Chart: