Question
Must be in Python 3 Please follow all the instructions listed below, thank you in advance! :D This project will both add to the Python
Must be in Python 3
Please follow all the instructions listed below, thank you in advance! :D
This project will both add to the Python class features that you have already used.
THE STUDENT CLASS
You are to code a class named Student.
A student object will contain the following data:
* a first name
* a last name
* a student gpa(float)
* the students major
The class is to provide the following methods:
* an __init__(self) method
* an __init__(self,first,last) method
* a __str__ method, so that an object of type Student can be printed
* a __lt__ method, so that two objects of type Student can be compared. Student comparison is to be based on the gpa field.
* a __gt__ method, so that two objects of type Student can be compared. Student comparison is to be based on the gpa field.
THIS CLASS SHOULD BE in A SEPARATE MODULE named Student.py
THE MAIN PROCESS
Your main process is test your Student class:
* create two Student objects. The user is to be prompted for first name, last name, gpa and major.
* print out the two objects (use your __str__ method)
* update the gpa of the second object (user provides new gpa)
* print out the larger of the two objects (use your __gt__ method to determine which is larger)
* print out the smaller of the two objects (use your __lt__ method to determine which is smaller)
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