You are on page 1of 5

D.S.

ADEGBENRO ICT POLYTECHNIC

NAME: IFEYEMI OLUWASEYI MCKNIGHT

MATRIC NUMBER: NCS-23-0011

DEPARTMERNT: COMPUTER SCIENCE

YEAR: ND1

COURSE TITLE: INTRODUCTION TO


PROGRAMMING LANGUAGE

COUSRE CODE: COM 113

DATE: 27TH February 2024


Write an algorithm and draw a flow chart for the following
1. To print those who fail or pass in com 113 when the pass mark is 50.
2. To print those who fail or pass in com 111, com 112 and com 113 when the average mark is 50.
3. Write a pseudo code for finding the greatest of 3 numbers represented as P,Q and R.
4. Write an algorithm to evaluate the area of com 113 class.
5. To calculate the root of the quadratic equation ay 2 +by 2 +c 2=0

SOLUTION
1. Step 1: create file A and B
Step 3: check students com 113 result score
Step 4: if student score is equal or above 50 input student name in file A
Step 5: if else input student name in file B
Step 6: print result
Step 7: end

Start

Create file A , B

Check student’s
com 113 score

Score 50 NO Input student


name in file B

YES

Input student
name in file A

Print A, B

Stop

2
Step 1: enter student data
Step 2: read values in com 111, com 112 and com 113
Step 3: calculate the average of the values
Step 4: if average is ≥ 50, add pass tag on student name
Step 5: if else add fail tag on student name
Step : print student result (R)
Step 7: end
Start

Enter student’s result data

Read values in com 111, com 112 and com 113 of all students

Calculate the average


= (com111+com112+com113) /4

Average 50
NO
Add fail tag to
student name

YES

Add pass tag to


student name

Print student’s result

Stop

3
Step 1: start process

Step 2: input P, Q, R

Step 3: if P > Q then big = P

Step 4: else big = Q

Step 5: if big > R then biggest = big

Step 6 : else biggest = R

4
Step 1: input the width (W) and length (L) of com113 class

Step 2: calculate the area (A) by multiplying L with w

STEP 3: Print A

Start

Input W, L

A = L*W

Print A

Stop

5
Step 1: input a, b, c
Step 2: d = SQRT (b * b – 4 * a * c)
Step 3: Y1 = (-b + d) / (2 * a)
Step 4: Y2 = (-b – d) / (2 * a)
Step 5: print Y1, Y2

Start

Input A, B, C

D = SQRT + (b * b – 4 *a * b * c)

Y1 = (-b + d) / (2 * a)

Y2 = (-b - d) / (2 * a)

Print Y1, Y2

Stop

You might also like