Answered step by step
Verified Expert Solution
Question
1 Approved Answer
hMake a file called modHuman.py call the class student. Then create another folder called testStudent the class must work with code. Your Turn: Student Class
hMake a file called modHuman.py
call the class student.
Then create another folder called testStudent the class must work with code.
Your Turn: Student Class Class Student ATTRIBUTES: -lastName: str -firstName: str -gpa: float METHODS: >Student(last:str; first:str; gpa: float) +setLastName(int): void #doesn't return anything +setFirstName(str):void #doesn't return anything +setGPA(float):void #doesn't return anything +getLastName(): str #returns a string +getFirstName(): str #returns a string +getGPA():float #returns a float +str(): str #returns a string from modPerson import s1 = Student("Jones", "Joe", 3.5); print("Student 1:", s1) s1.setLastName "Johnson") print("Student 1 after changing last name: ", s1) I s2 = Student("Smith", "Sue", 4.0); print("Student 2:, s2) print("Student 2 First Name: ", s2.getFirstName()) s2.setGPA(3.1) print("Student 2 after changing GPA:, s2.getGPA)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started