You are on page 1of 3

Second Term Summative Work

1. Explain the problem

Write an algorithm to determine what are the student’s grades calculating the average
of four marks and indicate if they have passed or failed. The final grade is calculated as
the average of four marks.

2. Think of a solution algorithm

Step 1: Get the first, second, third and fourth mark.


Step 2: Calculate the average score by adding the four scores and then divide them by
four.
Step 3: If the student has a score of 60 and above, he will pass otherwise he will fail.
Step 4: Show the result on the screen.

3. Draw a flow chart

start

Input the four grades of the student

Find the average grade

Average: (grade 1 + grade 2 + grade 3 + grade 4) / 4

Is the average result higher than 60?

If yes If not

pass fail

stop
Write the program code

Grade 1 = int(input(“Enter the student’s first grade:”))

Grade 2 = int(input(“Enter the student’s second grade:”))

Grade 3 = int(input(“Enter the student’s third grade:”))

Grade 4 = int(input(“Enter the student’s fourth grade”))

avg=(grade1+grade2+grade3+grade4)/4

if (avg>=9):

print(“The student passes”)

if else:
print(“The student fails”)

You might also like