0% found this document useful (0 votes)
37 views12 pages

Computer Fundamentals

The document contains 3 questions asking to write pseudo code and draw flowcharts. Question 1 asks to read temperatures of 5 machines and indicate if below or above freezing. Question 2 asks to read results of 30 students and indicate if they passed or failed. Question 3 asks to read salaries of 100 teachers, calculate tax based on salary, and print the net salary. Pseudo code and flowcharts are provided for each question.

Uploaded by

Arslan Raja
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views12 pages

Computer Fundamentals

The document contains 3 questions asking to write pseudo code and draw flowcharts. Question 1 asks to read temperatures of 5 machines and indicate if below or above freezing. Question 2 asks to read results of 30 students and indicate if they passed or failed. Question 3 asks to read salaries of 100 teachers, calculate tax based on salary, and print the net salary. Pseudo code and flowcharts are provided for each question.

Uploaded by

Arslan Raja
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 12

Hafiz Arslan Khalid

 
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.

 It is a methodology that allows the programmer to represent the implementation of


an algorithm.

 Simply it's the cooked up representation of an algorithm.


QUESTION NO # 01

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

its flow chart and write pseudo code.


PSEUDO CODE:
Step 1: START
Step 2: SET N = 1
Step 3: REPEAT until N > 31
Step 4: INPUT %
Step 5: IF % < 50
Step 6: PRINT pass
Step 7: ELSE PRINT fail
Step 8: N = N + 1
Step 9: STOP
START
Flowchart for
N=1 Result of 30 students

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

END PRINT Net


INPUT
salary
Net = salary - tax

IF False
salary tax = 20% * salary
≥ 20000

tax = 22% * salary

True

You might also like