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

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!