Professional Documents
Culture Documents
Bài N P Flowchart
Bài N P Flowchart
Exercise 5: Design an algorithm in flowchart to check whether a point A(x, y) is on, inside or
outside the circle with center O(x0, y0) and radius of size R.
start
Input a, b, c
No
(a<b+c)&&
(b<a+c)&& Print " Not a triangle"
No
(c<a+b )
yes
a*a=b*b+c*c||
b*b=a*a+c*c||
c*c=a*a+b*b
yes No
yes
(a==b)||(b==c)||(c==a ) (a==b)&&(b==c)&&(c==a ) print " equilateral triangle"
yes
no
print " right-angled " (a==b)||(b==c)||(c==a ) print " normal triangle"
yes
End
Exercise 9: Design an algorithm in flowchart to calculate the average of four grades of four subjects of a
student and determine whether students “Pass” (>=60) or “Fail”.