0% found this document useful (0 votes)
47 views5 pages

Activity Final

The document discusses creating a program to compute student grades based on their prelim, midterm, and final exam scores, including calculating the average, determining the grade point equivalence, and possible remarks. It also provides examples of using if/else statements and switch/case statements in Python code to implement conditional logic for determining grades and outputting results.

Uploaded by

Dearly Wurtzbach
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views5 pages

Activity Final

The document discusses creating a program to compute student grades based on their prelim, midterm, and final exam scores, including calculating the average, determining the grade point equivalence, and possible remarks. It also provides examples of using if/else statements and switch/case statements in Python code to implement conditional logic for determining grades and outputting results.

Uploaded by

Dearly Wurtzbach
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Activity : # 4

Simple Student Grading Summary Reports

Problem:
Create a program that will computer the grade of every
students

Given:

Student No : (9999999999)
Student Name : xxxxxxxxxxxxxxxxxxxx
Course : xxxxxxxxxxxx (Combobox)
Subject : xxxxxxxxxxxxxxxxxxxxxxxx
Prelim Grade : 99 (89)
Midterm Grade : 99 (90)
Final : 99 (90)
Formula : (Prelim Grade + Midterm Grade + Final)/3
Average : 99.99 (89.5)
Remarks : (If Statement)
Grade Point Equivalence : 9.99 (Case Statement)

Grade Table

Average Grade Point Equivalence Remarks


95%-100% 1.00 Excellent
91%-94% 1.25 Superior
88%-90% 1.50 Very Good
86%-87% 1.75 Good
84%-85 2.00 Very Satisfactory
82%-83% 2.25 High Average
79%-80% 2.50 Average
77%-78% 2.75 Fair
75% - 76% 3.00 Pass
58%-74.99 4.00 Conditional if Pass/Failed
58.49 below 5.00 Failing Final Grade

Python if..else Flowchart


Python if..else Flowchart

Flowchart of if...else statement in Python


Programming
Syntax
The syntax of the nested if...elif...else construct may be −
if expression1: 5>2
statement(s)
elseif expression2:
statement(s)
elseif expression3:
statement(s)
elseif expression4:
statement(s)
else:
statement(s)
else:
statement(s)

Example

var = 100
if var < 200:
print "Expression value is less than 200"
if var == 150:
print "Which is 150"
elif var == 100:
print "Which is 100"
elif var == 50:
print "Which is 50"
elif var < 50:
print "Expression value is less than 50"
else:
print "Could not find true expression"

print "Good bye!"

Switch Case in Python (Replacement)

. How to Implement Switch Case Statement in Python

Example
switch (dayOfWeek) {
case 1:
printf("%s", Monday);
break;
case 2:
printf("%s", Tuesday);
break;
case 3:
printf("%s", Wednesday);
break;
case 4:
printf("%s", Thursday);
break;
case 5:
printf("%s", Friday);
break;
case 6:
printf("%s", Saturday);
break;
case 7:
printf("%s", Sunday);
break;
default:
printf("Incorrect day");
break;
}

You might also like