Computer Fundamentals
Computer Fundamentals
Roll No. 20013122-013
Department: ELECTRICAL ENGINEERING DEPARTMENT
Subject: Computer Fundamentals
Quiz # 2: Pseudo Code and Flowchart
Submitted to: Prof. Usman Alvi
Date Submission: 7 – Feb – 2021
WHAT IS PSEUDO CODE?
Pseudo code is a term which is often used in programming and algorithm based
fields.
Read the temperature of 5 machines. If the temperature of any machine is less than
32°C indicate below freezing on the screen. Else if the temperature is above 32°C. It
will indicate above freezing. Draw its flow chart and write pseudo code.
PSEUDO CODE:
Step 1: START
Step 2: SET N = 1
Step 3: REPEAT until N > 6
Step 4: INPUT temp
Step 5: IF temp < 32
Step 6: PRINT below freezing
Step 7: ELSE PRINT above freezing
Step 8: N = N + 1
Step 9: STOP
START
Flowchart for
N=1 Temperature of 5 machines
WHILE
N≤5
N=N+1
END
INPUT
temp
IF False PRINT
temp Below freezing
< 32
PRINT
Below freezing
True
QUESTION NO # 02
Read the result of 30 students. If the result of any student is less than 50% print fail
on the screen. Else if the result is above 50%. It should print pass on the screen. Draw
WHILE
N ≤ 30
N=N+1
END
INPUT
%
IF False
% PRINT Fail
≤ 50
PRINT Pass
True
QUESTION NO # 03
Read the salary of 100 teachers. If the salary of any teacher is less than 20,000 Rs
then tax is 20% of total salary. Else if the salary is above 20,000. the tax will be 22%
of total salary. Print the net salary left after paying tax. Draw its flow chart and write
pseudo code.
PSEUDO CODE:
Step 1: START
Step 2: SET N = 1
Step 3: REPEAT until N > 101
Step 4: INPUT salary
Step 5: IF salary < 20000
Step 6: tax = 20 % * salary
Step 7: ELSE tax = 22% * salary
Step 8: net = salary – tax
Step 9: PRINT net
Step 10: N = N + 1
Step 11: STOP
START
Flowchart for
N=1 Salary of 100 Teachers
WHILE N=N+1
N ≤ 100
IF False
salary tax = 20% * salary
≥ 20000
True