Sei sulla pagina 1di 3

Exercise Chapter 1 & Chapter 2

1) Write an algorithm to find pass or fail. Flowchart:


Input: Four numbers M1, M2, M3, and M4
Output: G (Pass or Fail) Start
Operation: Comparison
1. Read M1,M2,M3,M4
2. G=(M1+M2+M3+M4)/4 Input Numbers M1=10, M2=12,
3. If(G>60) then M3=18, M4=10
Print Pass

Else
G= (M1+M2+M3+M4)/4
Print Fail

Endif

4. Stop
Is G>60

Yes No

Print Pass Print Fail

Stop
2) Write an algorithm, draw Flowchart to convert the length in feet to centimetre
C=F*30

Input: One number F Flowchart:


Output: C
Operation: C=F*30 Start
1. Read F A=50 B=40
2. C=F*30
3. Print C
4. Stop Input one
number F=20

C=F*30

Print C

Stop

3) Write an algorithm, draw flowchart that will read the two sides of a rectangle and
calculate its area Area=L*W.

Input: Two numbers L, W Flowchart:


Output: Area
Operation: Area=L*W Start
1. Read L,W A=50 B=40
2. Area=L*W
3. Print Area
Input two
4. Stop numbers
L=20, W=10
Area=L*W

Print Area

Stop
A=50 B=40

4) Write an algorithm, draw flowchart to change temperature from Celsius to


Fahrenheit.
C=5*(F-32)/9
5) Write an algorithm, draw flowchart to display smallest of two numbers.
6) Write an algorithm, draw flowchart for the below given expression.
i) Z=2*A+3*B+C
ii) D=A*(B+C)

Potrebbero piacerti anche