You are on page 1of 10

MACHINE PROBLEM 4

NAME: Christine Mae T. Cion DATE: November 27, 2021


SECTION: BSCS 3A STUDENT NO: 194-0437
______________________________________________________________________

Table 1: Inputs
DESCRIPTION INPUT VARIABLES

QUIZ Q1, Q2, Q3

ACTIVITIES A1, A2

EXAM SCORE ES
● Input must be in range of 50 to 100 only

Table 2: Processes
PROCESS VARIABLES

Calculate the Average Quizzes in Decimal form AQ

Calculate the Average of Activities in Decimal form AA

Calculate the Exam Rate by adding 50 to the ES ER

Calculate the 20% of AQ QP

Calculate the 30% of AA AP

Calculate the 50% of ER EP

Calculate the sum of QP, AP, and EP

Table 3: Equivalent Grade


Grade range Equivalent

99 - 100 1.00

95 - 98 1.25

91 - 94 1.50

87- 90 1.75

83-86 2.00

79-82 2.50
76-78 2.75

75 3.00

Below 75 5.00

Table 4: Grade remarks


Grade range Remarks

Higher than 74 Passed

Lower than 75 Failed

Table 5:

Description Function

Use Table 2 Process()

Use Table 3 Equivalent_Grade()

Use Table 4 Remarks()

Do the following:
1. Construct the flowchart, Pseudocode and code of the following
processes:
a. The system must accept values of Quizzes, Activities and
exam (based on the inputs on table 1 above)
b. Then execute all the process (based on table 2 above)
c. Display the Calculated Grade, the equivalent Grade (Based
on table 3, and Remarks (Based on table 4)
d. Then it will ask you if you want to “calculate grade again
press [Y] / any key to exit”, if Y then it will repeat the
process from the start otherwise it will terminate the
process.
FLOWCHART:
PSEUDOCODE:

Start
initialize again = "Y"
while again == "Y"

If True:
INPUT: Q1, Q2, Q3, A1, A2, ES
PROCESS:
AQ = (Q1+Q2+Q3)/3
AA = (A1+A2)/2
ER = ES + 50
QP = AQ * .20
AP = AA * .30
EP = ER * .50
sum = QP + AP + EP
OUTPUT: Equivalent_Grade()
If Process() >= 99 and Process() <= 100 is true
OUTPUT: Equivalent Grade: 1.00
Elif Process() >= 95 and Process() <= 98 is true
OUTPUT: Equivalent Grade: 1.25
Elif Process() >= 91 and Process() <= 94 is true
OUTPUT: Equivalent Grade: 1.50
Elif Process() >= 87 and Process() <= 90 is true
OUTPUT: Equivalent Grade: 1.75
Elif Process() >= 83 and Process () <= 86 is true
OUTPUT: Equivalent Grade: 2.00
Elif Process() >= 79 and Process() <= 82 is true
OUTPUT: Equivalent Grade: 2.50
Elif Process() >= 76 and Process() <= 78 is true
OUTPUT: Equivalent Grade: 2.75
Elif Process() == 75 is true
OUTPUT: Equivalent Grade: 3.00
Else:
OUTPUT: Equivalent Grade: 5.00
OUTPUT: Remarks()
If Process() >= 75:
OUTPUT: Remarks: Passed
Else:
OUTPUT: Remarks: Failed
OUTPUT:
Call function Process()
Call function Equivalent_Grade()
Call function Remarks()
INPUT: Value for again, Calculate Grade Again? Press [Y] / any
key to exit:
If False:
OUTPUT: Always do your best!
Stop
CODE (Copy paste not screen shot)

def Process():
AQ = (Q1+Q2+Q3)/3
AA = (A1+A2)/2
ER = ES + 50
QP = AQ * .20
AP = AA * .30
EP = ER * .50
sum = QP + AP + EP

return sum

def Equivalent_Grade():

if Process() >= 99 and Process() <= 100:


print("Equivalent Grade: 1.00")
elif Process() >= 95 and Process() <= 98:
print("Equivalent Grade: 1.25")
elif Process() >= 91 and Process() <= 94:
print("Equivalent Grade: 1.50")
elif Process() >= 87 and Process() <= 90:
print("Equivalent Grade: 1.75")
elif Process() >= 83 and Process () <= 86:
print("Equivalent Grade: 2.00")
elif Process() >= 79 and Process() <= 82:
print("Equivalent Grade: 2.50")
elif Process() >= 76 and Process() <= 78:
print("Equivalent Grade: 2.75")
elif Process() == 75:
print("Equivalent Grade: 3.00")
else:
print("Equivalent Grade: 5.00")

def Remarks():

if Process() >= 75:


print("Remarks: Passed")
else:
print("Remarks: Failed")

again = "Y"

while again == "Y":


Q1 = float(input("Quiz 1: "))
Q2 = float(input("Quiz 2: "))
Q3 = float(input("Quiz 3: "))

A1 = float(input("Activity 1: "))
A2 = float(input("Activity 2: "))

ES = float(input("Exam Score: "))

print("Calculated Ave: ", Process())


Equivalent_Grade()
Remarks()
again = input("Calculate Grade Again? Press [Y] / any key to exit: ").upper()

print("Always do your best!")


OUTPUT (Screen shot)

You might also like