0% found this document useful (0 votes)
20 views4 pages

Sucgang - Week5 - Programming Session

The document describes a Python program that takes a student's attendance percentage and score as input and outputs their grade based on criteria where a score below 60 or attendance below 75% results in a grade of fail, otherwise different score ranges result in grades of A through D.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views4 pages

Sucgang - Week5 - Programming Session

The document describes a Python program that takes a student's attendance percentage and score as input and outputs their grade based on criteria where a score below 60 or attendance below 75% results in a grade of fail, otherwise different score ranges result in grades of A through D.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

PAMANTASAN NG LUNGSOD NG MUNTINLUPA

COLLEGE OF INFORMATION TECHNOLOGY AND COMPUTER STUDIES

University Road, Poblacion, Muntinlupa City

Sucgang,Richard L. PROFELEC2 – Python Programming


BSIT – 3H Ms. Kaycee R. Mendez

Week 5 – Programming Session

Directions: Screenshot/Printscreen your codes and output, copy the raw codes and paste
it here. You may name your file LastnameGradingSystem.py

Note: Your program should be properly COMMENTED and include the name of the student.

Programming Problem 3 using nested if else statements:


(Student Grading System using NUMBERED INDEX)

Write a Python program that takes a student's score and attendance status as input and determines the
grade based on the following criteria:

If the attendance is less than 75%, regardless of the score, the grade is "Fail."
If the attendance is 75% or higher:
If the score is 90 or above, the grade is "A."
If the score is between 80 and 89 (inclusive), the grade is "B."
If the score is between 70 and 79 (inclusive), the grade is "C."
If the score is between 60 and 69 (inclusive), the grade is "D."
If the score is below 60, the grade is "Fail."
Make sure to include error handling for invalid input (attendance percentages outside the valid range).

SCREENSHOTS OF CODES:

Week 5 – Programming Session


PAMANTASAN NG LUNGSOD NG MUNTINLUPA
COLLEGE OF INFORMATION TECHNOLOGY AND COMPUTER STUDIES

University Road, Poblacion, Muntinlupa City

SCREENSHOTS OF OUTPUT:

Week 5 – Programming Session


PAMANTASAN NG LUNGSOD NG MUNTINLUPA
COLLEGE OF INFORMATION TECHNOLOGY AND COMPUTER STUDIES

University Road, Poblacion, Muntinlupa City

RAW CODES:

#Sucgang, Richard L.
#IT3H
#Week 5 - Programming Session
#Week 5 - Programming Problem 3 using nested if else statements:
#(Student Grading System using NUMBERED INDEX)

a = float(input("Enter student attendance%: "))


b = int(input("Enter student score: "))

if (0 <= a <= 100):

if (0 <= b <= 100):

if (a>=75):
if (b>=90):
print("A")
elif (80 <= b <=89):
print("B")
elif (70 <= b <=79):
print("C")
elif (60 <= b <=69):
print("D")
elif (b<=60):
print("Fail")
else:
print("Fail")

else:
print("Fail")

else:
print("Score is in invalid range! Please enter 0 to 100 only")
else:
print("Student Attendance% is in invalid range! Please enter 0 to 100 only")

Week 5 – Programming Session


PAMANTASAN NG LUNGSOD NG MUNTINLUPA
COLLEGE OF INFORMATION TECHNOLOGY AND COMPUTER STUDIES

University Road, Poblacion, Muntinlupa City

Week 5 – Programming Session

You might also like