You are on page 1of 21

ALGORITHM

AGAM,JOSHUA
BSCE 2-1
1.
Algorithm
Declare 3 variables, 1 for the width, 1 for the length and 1 for the area
Let the user input the multiplication
Perform the multiplication between the length and width and assign it tot the product
Display product

Pseudocode
Let length = 0 width = 0 and area=0
Input length width and area
Area= Length * width
Display=area
Flow chart
Flow chart
2
Algorithm
Declare 7 variable, 1 for test 1, 1 for test 2, 1 for test 3, 1 for test 4, 1 for test 5, 1 for sum
and 1 for average
Perform the addition between in th 5 test then divide it in 5 to get average
Display average

Pseudocode
Let test 1=0 test 2=0 test3=0,test 4=0 test 5=0, Sum=0 and average=0
Input test 1, test2 test 3 test 4 and test 5
Sum= test1+test2+test3+test4+test5
Average= sum/2
Output=average
FLOW CHART
FLOW CHART
3
Algorithm
Declare 4 variables,11 variable is for product
let the user input multiplication
Perfomed multiplication beetween the three variables and assign the product
Display product

Pseudocode
let numberone=0 numbertwo=0numberthree=0 and product=0
Input numberone, numbertwo,numberthree
product= numberone*numbertwo*numberthree
output=product
FLOW CHART
FLOW CHART
4
Algorithm
Declare variable numbers
Let the user input the numbers
Performed assign if the number is 0 and 40 write blue, If the number assign between 41 and 80 assignred
and if the number between 81 and 100 assign yellow and if theres no number assig no color
display color

Pseudocode
Let number 0 let color=0
input number
If the number is between 0and 40
output blue
If the number is between41-80
Ouput Red
If the number is between 81 and 100
ouyput yellow
If theres no number
output no color
FLOW CHART
FLOW CHART
FLOW CHART
5
Algorithm
declare number grades
Let the user input grades
Perform assign 1.00 then the grades is 97-100, if 1.25 then the grades is 94-
96, If 1.50 then the grades is 91-93, If 1.75 the grades is 88-90, If 2.00 then
the grades is 85-87, If 2.25 then the grades is 82-84, If the grades is 2.50 then
the grades is 79-81, I f2.75 then the grades is 76-78, if 3.00 then the grades is
754 if 5.00 then the grades is 74 below, and if error then the grade is 100
above
Display grades
5
Pseudocode
if the grades is 82-84
Let grades=0
output 2.25
Input Grades
if the grades is 70-82
If the grades 97-100
output 2.50
output 1.00
if the grades is 76-78
if the grades is 94-96
output 2.75
output 1.25
if the grades is 75
if the grades is 91-93
output 3
output 1.50
if the grades is 74 below
if the grades is 88-90
output 5
output 1.75
if the grades is error
if the grades is 85-87
output 100 above
output 2.00
FLOW CHART
FLOW CHART
FLOW CHART
FLOW CHART
FLOW CHART

You might also like