Question: The class Student has four private attributes to define its first name, last name, address, and total score. Implement the function getResult based on the

The class Student has four private attributes to define its first name, last name, address, and total score. Implement the function getResult based on the logic, if the student score is above 60, it will be Pass and otherwise, it will be Not Pass.

The following test case reveals the use of the class. Define a Python class to match the test case given below.

#Test: Do NOT change this code
s1 = Student()
s1.setFirstName("Ahmad")
s1.setLastName("Salem")
s1.setScore(60)
s1.setAddress("Al Raha Beach")
print(s1.getFullName()) # prints full name example: Ahmed Salem
print(s1.getResult()) # prints Pass or Not Pass 
s2 = Student("Reem", "Saed", 82, "Abu Dhabi")
print(s2.getAddress()) # prints all the details of the student 
 
print(s2) # Reem Saed, Abu Dhabi, 82, Pass

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!