0% found this document useful (0 votes)
69 views6 pages

Start Read G 1, G 2, G 3 Sum G 1 + G 2 + G 3 Average Sum / 3 Write Average End

This document contains the solutions to 5 exercises completed by Muhammad Zain for their Computer Programming Lab course. The exercises involve drawing flowcharts for programs that: 1) Calculate the average of 3 grades, 2) Calculate the volume of a rectangular box, 3) Test if an input value is positive, negative, or zero, 4) Determine an employee's job title based on their salary, and 5) Predict insect populations for weeks 3 and 4 based on growth rates from weeks 1 and 2. Muhammad Zain provided the flowcharts and descriptions for each of the 5 exercises.

Uploaded by

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

Start Read G 1, G 2, G 3 Sum G 1 + G 2 + G 3 Average Sum / 3 Write Average End

This document contains the solutions to 5 exercises completed by Muhammad Zain for their Computer Programming Lab course. The exercises involve drawing flowcharts for programs that: 1) Calculate the average of 3 grades, 2) Calculate the volume of a rectangular box, 3) Test if an input value is positive, negative, or zero, 4) Determine an employee's job title based on their salary, and 5) Predict insect populations for weeks 3 and 4 based on growth rates from weeks 1 and 2. Muhammad Zain provided the flowcharts and descriptions for each of the 5 exercises.

Uploaded by

Muhammad Zain
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 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