Lab 1
Lab 1
Start
Input a,b, c
False True
a>c
Min = a Min = c
?
False True
End
Exercise 5:
Start
Input x, y, R
D = sqrt(x*x +
y*y)
True
R=0 Display “Choose
? another radius”
False
False False
D=R D>R Display “Point A
? ? is inside the
circle”
True
True
Display “Point A Display “Point A
is on the circle” is outside the
circle”
End
Exercise 6:
Start
Input a,b, c
False True
a=0 Display “Choose
del= b*b – 4*a*c ? another number for
a”
True True
End
Exercise 7:
Start
S=N
C=1
Input string
N
N= False S=S+N
Display N C=C+1
“Stop”
True
Ave = S/C
End
Exercise 8:
Start
Input a,b, c
a=0 True
Display “a, b, c must
||
be different from 0”
b=0
False
m = sqrt(a*a + b*b)
n = sqrt(a*a + c*c)
p = sqrt(c*c + b*b)
Display” This
triangle is right-
angled”
End
Exercise 9:
Start
Ave = (grade1 +
grade2 + grade3 +
grade4)/4
False
Ave True
Display “Fail” Display “Pass”
>=6
End
Exercise 10:
Start
Input a,b,c,d,e,f
X = (c*e – b*f)/(a*e –
b*d)
Y = (a*f – c*d)/(a*e –
Display
“a is”,
a,
“b is”,
b,
“c is”,
c,
“d is”,
d,
“e is”,
End
Exercise 11:
Start
Input Y
True
Display “Leap
Display “Leap
year”
year”
End
Exercise 12:
Start
i=i+1
Input N T = N*(N – i)
True
False False
N<=0 N=1 i=1 I<N
True False
End