You are on page 1of 6

CSL-113 : Computer Programming Lab

Semester : BS CS – 1A
Name : Muhammad Zain
Enroll no : (02-134182-037)

Exercise 1 (grades)

Draw a flowchart to read a student’s three grades, calculate the average of the grades,
then display the average grade.

Task #1

start

Read g 1 ,g 2 ,g 3

Sum = g 1 + g 2 + g 3

Average = sum / 3

Write average

end

CSL-113: Computer Programming Lab Lab 01 : Getting Started (Pseudo code,Algorithums


& Flowchrt)
CSL-113 : Computer Programming Lab
Semester : BS CS – 1A
Name : Muhammad Zain
Enroll no : (02-134182-037)

Exercise 2 (volume)
Draw a flowchart for a program that reads the height, length, and width of a
rectangular box, calculates and displays the volume. Note: volume = lwh

Task#2

start
Read length, height and
width

volume = length*height*width

Write volume

End

CSL-113: Computer Programming Lab Lab 01 : Getting Started (Pseudo code,Algorithums


& Flowchrt)
CSL-113 : Computer Programming Lab
Semester : BS CS – 1A
Name : Muhammad Zain
Enroll no : (02-134182-037)

Exercise 3 (input values)


Draw a flowchart for a program that prompts the user to input an integer value and
tests if the input value is positive or negative. The program displays an output
message according to the following cases: a. Input value is 0
b. Input value is positive
c. Input value is negative

Task 3

start

Promt user to
input x

Read x

If x is +ve Yes Input is


positive
no
If x is -ve yes Input is
negative
no
X is o end

CSL-113: Computer Programming Lab Lab 01 : Getting Started (Pseudo code,Algorithums


& Flowchrt)
CSL-113 : Computer Programming Lab
Semester : BS CS – 1A
Name : Muhammad Zain
Enroll no : (02-134182-037)

Exercise 4 (Salary)
Draw a flowchart to reads the salary of an employee and prints:
"Manager" → if the salary is above 20000,
"Supervisor" → if the salary is above 15000,

"Technician" → if the salary is above 8000..

Task 4

start

Promt user to
input x

Read x

Write
If x >20000 Yes
manager
no
Write
If x >15000 yes end
supervisor
no
Write
X is 8000
manager

CSL-113: Computer Programming Lab Lab 01 : Getting Started (Pseudo code,Algorithums


& Flowchrt)
CSL-113 : Computer Programming Lab
Semester : BS CS – 1A
Name : Muhammad Zain
Enroll no : (02-134182-037)

Exercise 5 (Prediction)
We would like to predict the size of an insect population for the week 3 and 4 based
on data for week 1 and 2. The weekly rate of growth is a percentage of the
population at the beginning of the week. Draw flow chart of this problem.

Task 5

CSL-113: Computer Programming Lab Lab 01 : Getting Started (Pseudo code,Algorithums


& Flowchrt)
CSL-113 : Computer Programming Lab
Semester : BS CS – 1A
Name : Muhammad Zain
Enroll no : (02-134182-037)

CSL-113: Computer Programming Lab Lab 01 : Getting Started (Pseudo code,Algorithums


& Flowchrt)

You might also like