Question: Extend the previous Student class as a superclass with two base classes with additional attributes: PYTHON Current: semesters_remaining Alumna: yr_of_grad, active_member (boolean) Once you have

Extend the previous Student class as a superclass with two base classes with additional attributes:

PYTHON

Current: semesters_remaining

Alumna: yr_of_grad, active_member (boolean)

Once you have written the class (filename student2.py), write a program (filename hw1.py) that creates 2 Current objects and 2 Alumna objects. Your program should display the data for each student on the screen.

example output:

Current 1: Jane Doe, 9001111, Sophomore, CIS, 4.0

5 semesters remaining

Current 2: Issa Rae, 9001234, Senior, BIO, 2.5

1 semester remaining

Alumna 1: Mary Beth, 90212938, Grad, ART, 3.4

Active Member: Yes

Alumna 2: Zoe Smith, 90012020, Grad, HIS, 3.2

Active Member: No

here is my code:

//

# define class class Student: """Here i am geting basic information about a student""" # intilize the name,ID,classification,major, and gpa and allow for no input def __init__(self,name = None,ID = None,classification=None,major= None,gpa=None):#constructor for name class if name is None: self.__name = '' else: self.__name = name if ID is None: self.__ID = 0 else: self.__ID = ID if classification is None: self.__classification = '' else: self.__classification = classification if major is None: self.__major = '' else: self.__major = major if gpa is None: self.__gpa = 0 else: self.__gpa = gpa #setter functions for name,ID,classification,major,and gpa def set_name(self,name): #sets name of person self.__name = name def set_Id(self,ID): #sets ID of student self.__ID = ID def set_classification(self,classification):#sets classification of student self.__classification = classification def set_major(self,major): self.__major = major def set_gpa(self,gpa): self.__gpa = gpa #getter functions for name,ID,classification,major,and gpa def get_name(self): return self.__name def get_ID(self): return self.__ID def get_classification(self): return self.__classification def get_major(self): return self.__major def get_gpa(self): return self.__gpa

//

//main

import studentinfo

def main(): #first object to initilize the student info in constructor studentA = studentinfo.Student('Jayla',900745231,'junior','computer science',3.3) print(studentA.get_name()) #print name,ID,classification,major,and gpa of studen print(studentA.get_ID()) print(studentA.get_classification()) print(studentA.get_major()) print(studentA.get_gpa()) #change name of student studentA.set_name('Karmen') #print the changed name of student print(studentA.get_name()) print() #empty line

StudentB = studentinfo.Student()#initilize a conctructor for second object to make the info empty StudentB.set_name('Bobby') #set name,ID,then print name and ID StudentB.set_Id(764532) print(StudentB.get_name()) print(StudentB.get_ID()) print(StudentB.get_classification()) #will print empty line print(StudentB.get_major()) #will print empty line print(StudentB.get_gpa()) #will print a 0 print() StudentB.set_name('Karen') #will change name from bobby to karen print(StudentB.get_name()) #prints new name and same ID print(StudentB.get_ID())

print() studentC=studentinfo.Student() #initilize a conctructor for third object to make the info empty

studentC.set_name('Jada')#set name,id,classification,major,and gpa and print them all by getting them

studentC.set_Id(123456)

studentC.set_classification('Junior')

studentC.set_major('Computer Science')

studentC.set_gpa(3.86)

print(studentC.get_name())

print(studentC.get_ID())

print(studentC.get_classification())

print(studentC.get_major())

print(studentC.get_gpa()) StudentD = studentinfo.Student()#initilize a conctructor for fourth object to make the info empty

StudentD.set_name('Kathryn') #set name,id,classification,major,and gpa and print them all by getting them

StudentD.set_Id(123457)

StudentD.set_classification('Junior')

StudentD.set_major('Computer Science')

StudentD.set_gpa(3.37)

print()

print(StudentD.get_name()) print(StudentD.get_ID())

print(StudentD.get_classification())

print(StudentD.get_major())

print(StudentD.get_gpa())

StudentE = studentinfo.Student()#initilize a conctructor for fifth object to make the info empty

StudentE.set_name('Treasure')#set name,id,classification,major,and gpa and print them all by getting them

StudentE.set_Id(123458)

StudentE.set_classification('Junior')

StudentE.set_major('Computer Science')

StudentE.set_gpa(3.3)

print()

print(StudentE.get_name())

print(StudentE.get_ID()) print(StudentE.get_classification())

print(StudentE.get_major())

print(StudentE.get_gpa())

studentF = studentinfo.Student()#initilize a conctructor for sixth object to make the info empty

studentF.set_name('Riley')#set name,id,classification,major,and gpa and print them all by getting the

studentF.set_Id('123459')

studentF.set_classification('Junior')

studentF.set_major('Computer Science')

studentF.set_gpa(4.0)

print()

print(studentF.get_name())

print(studentF.get_ID())

print(studentF.get_classification())

print(studentF.get_major())

print(studentF.get_gpa())

main() #call main

//

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!