Machine Problem in Python 

1. Create an app that computes students average solve using classes.

2. The user will input the following (Name, Math, Science and English Grade)

3. Create a Class called Students

4. Use the init function to collect the student information (Name, Math, Science and English Grade)

5. Create a function that will perform the computation of the average

6. Create a function that will display the result

SAMPLE OUTPUT:

Name: Jake R. Pomperada

Math: 90

Science: 90

English: 90

Average: 90 (Passed)

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me at the following email address for further details.  If you want to advertise on my website, kindly contact me also at my email address also. Thank you.

My email address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com

My mobile number here in the Philippines is 09173084360.

Program Listing

# student_grade_classes.py
# Jake Rodriguez Pomperada, MAED-IT, MIT
# July 29, 2021   Thursday
# www.jakerpomperada.com  and www.jakerpomperada.blogspot.com
# jakerpomperada@gmail.com
# Bacolod City, Negros Occidental Philippines

class Students:
    def __init__(self, name, math, science, english):
        self.pangalan = name
        self.matematika = math
        self.agham = science
        self.ingles = english

    def ave(self):
        self.average = (self.matematika + self.agham + self.ingles) / 3

    def show(self):
        self.ave()
        print("Name: ", self.pangalan)
        print("Math Grade: ", self.matematika)
        print("Science Grade: ", self.agham)
        print("English Grade: ", self.ingles)
        if self.average >= 75:
            self.status = "Passed"
        else:
            self.status = "Failed"
        print("Average Grade: {} ({})".format(round(self.average,0), self.status))

print()
print("Student Average Grade Using Classes in Python")
print()
Name = str(input("Enter Name: "))
Math = float(input("Enter Math: "))
Science = float(input("Enter Science: "))
English = float(input("Enter English: "))
print()

stud = Students(Name, Math, Science, English)
stud.show()

Leave a Reply

Your email address will not be published.