Professional Documents
Culture Documents
Americalisa - 5782 - 1018256 - BSCE 2-1 AMERICA ALGORITHM
Americalisa - 5782 - 1018256 - BSCE 2-1 AMERICA ALGORITHM
BSCE 2-1
Algorithm:
1. Declare 3 variables, 1 for the Length, 1 for the Width, and 1 for the Area.
2. Let the user input the Length and Width.
3. Perform multiplication between the Length and Width and assign it to the Area.
4. Display the Area.
Pseudocode:
1. Let Length = 0, Width = 0, and Area = 0
2. Input Length and Width
3. Area = Length * Width
4. Output Area
FLOWCHART:
2. Write an algorithm, pseudocode, and draw a flowchart to determine whether the
students have passed or failed a course; a student needs an average of 75 on five
tests.
Algorithm:
1. Declare 6 variables, 5 for Addends, and 1 for the Average.
2. Let the user input the Addends.
3. Perform addition between the addends and divide the sum into 5.
4. Display “Passed” if Average>=75.
5. Display “Failed” if Average is <75
Pseudocode:
1. Let Test1 = 0, Test2 = 0, Test3 = 0, Test4= 0, Test5 = 0, and Average = 0
2. Input Test1, Test2, Test3, Test4, and Test5
3. Average = (Test1 + Test2 + Test3 + Test4 +Test5)/5
4. If Average >= 75, Output “Passed”
Else Output “Failed”
End if
Flowchart:
3. Create an algorithm, pseudocode, and draw a flowchart that reads three numbers
and multiplies them together, and prints out their product.
Algorithm:
1. Declare 4 variables, 3 for Multipliers, and 1 for the Product.
2. Let the user input the Multipliers.
3. Perform multiplication between the multipliers and assign it to the Product.
4. Display the 3 Multipliers and the Product.
Pseudocode:
1. Let numOne = 0, numTwo = 0, numThree = 0, and Product = 0.
2. Input numOne, numTwo, and numThree.
3. Product = numOne * numTwo * numThree
4. Output Multipliers and Product.
Flowchart:
Ask a user to enter a number. If the number is between 0 and 40, write the word
BLUE. If the number is between 41 and 80, write the word RED. if the number is
between 81 and 100, write the word YELLOW. If it is any other number, write it is
not the correct color option.
Algorithm:
1. Declare 1 variable for the number.
2. Let the user input the number.
3. Display “BLUE” if the number is between 0 and 40.
4. Display “RED” if the number is between 41 and 80.
5. Display “YELLOW” if the number is between 81 and 100.
6. Display “Not the Correct Color Option” if the number is less than 0 or greater
than 100.
Pseudocode:
1. Let num = 0.
2. Input num.
3. Output “BLUE” if num is between 0 and 40.
4. Output “RED” if num is between 41 and 80.
5. Output “YELLOW” if num is between 81 and 100.
6. Output “Not the Correct Color Option” if num>100.
7. Output “Not the Correct Color Option” if num<0.
1.00 = 97-100
1.25 = 94-96
1.50 = 91-93
1.75 = 88-90
2.00 = 85-87
2.25 = 82-84
2.50 = 79-81
2.75 = 76-78
3.00 = 75
5.00 = 74 below
Error = 100 above