Question: Must be in Python 3 Please follow all instructions listed below, thank you in advance!! :D Student Class:: class Student: def __init__(self): self.firstname =

Must be in Python 3

Please follow all instructions listed below, thank you in advance!! :D

Student Class::

class Student: def __init__(self): self.firstname = "" self.lastname = "" self.gpa = 0; self.major = ""

def __init__(self, first, last): self.firstname = first self.lastname = last self.gpa = 0; self.major = ""

def __str__(self): return self.firstname + " " + self.lastname + " has a GPA of " + str(self.gpa) + " and majors in " + self.major

def __1t__(one, two): if one.gpa < two.gpa: return one return two

def __gt__(one, two): if one.gpa > two.gpa: return one return two

Student Class Imported:

import Student

fname1 = input("Enter first name: ") lname1 = input("Enter last name: ") s1 = Student.Student(fname1, lname1) s1.gpa = float(input("Enter gpa: ")) s1.major = input("Enter your major: ")

fname2 = input(" Enter first name: ") lname2 = input("Enter last name: ") s2 = Student.Student(fname2, lname2) s2.gpa = float(input("Enter gpa: ")) s2.major = input("Enter your major: ")

if s1.gpa > s2.gpa: print("Student one has a higher GPA. ")

else: print("Student two has the higher GPA. ") print(" ", s1) print(" ", s2)

==========================================================================================

This project will use the Student class which is coded above.

You will be coding a program for XYZ Community College to help them keep track of student data . The finished program will allow:

* new student data to be stored

* student data to be accessed based on particular criteria (detailed below)

Your program will use a dictionary to store students and their 5 digit id numbers. This dictionary, which is empty when the program begins, will store (idnumber: student) pairs. For example, dict[idnum] = student1.

This is the same idea as your babyname dictionary from week 8, but the key is an int id number, and the value is a student object.

Your program should define and make use of the following functions:

printAll(dict) accepts one dictionary parameter and prints all data in the dictionary

findStudent(dict, idnum) accepts one dictionary parameter, and one idnumber parameter. If that

idnumber is a key in that dictionary, the paired value (student object) is printed

findMajor(dict, major) accepts one dictionary parameter, and a major parameter. All students in

the dictionary with that major are printed.

findGPA(dict, GPA) accepts one dictionary parameter, and a GPA parameter. All students in

the dictionary with a GPA greater or equal to the GPA parameter are printed.

Your program will allow the user to repeat the following until he/she wishes to exit:

* Enter a new student. The user will provide first name, last name, student GPA and major. Your program may have the user provide their id number, or have the program generate the new unique student id number(this can be done using an int variable in the keeping track of the last used idnumber, and adding one to this variable for each new student). The new id:student pair is to be placed in the dictionary, after checking that the id is not already a key in that dictionary.

* Find a particular student . The user will provide an id number, and if that student is currently stored, his/her information is printed.

* Print all student information currently stored

* Print all students that have a particular major. The user enters the major.

* Print all students with a GPA higher than a value provided by the user.

Extra Credit:

For 50% credit on one missing assignment do the following: output all stored student info (one student per line) to a text file.

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!