Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DB2 11 The Database For Big Data And Analytics

Authors: Cristian Molaro, Surekha Parekh, Terry Purcell, Julian Stuhler

1st Edition

1583473858, 978-1583473856

More Books

Students also viewed these Databases questions

Question

Write down ways in which you have found time is wasted in meetings.

Answered: 1 week ago

Question

3. Write a policy statement to address these issues.

Answered: 1 week ago