Question: Using this base student class program, create a declared student super class that inherits from the base student class. The program will use the methods
Using this base student class program, create a declared student super class that inherits from the base student class.
The program will use the methods of the student and declared student classes to accomplish the following:
Prompt the user for the first name, last name, and student declared concentration.
Create a declared student class that inherits from the student class.
Create a student object by passing the first and last name to the init method.
Create a declared student object by passing the concentration to the init method.
Create a loop that prompts the user for the following: The credits and grade for each course the student has taken.
Once the user ends the loop, display the student's cumulative GPA and student year.
class Student:
def initself firstname, lastname:
self.firstname firstname
self.lastname lastname
self.gradepoints
self.credits
self.gpa
def calculateGPAself grades, credits:
self.credits self.credits credits
if grades A:
self.gradepoints self.gradepoints credits
if grades B:
self.gradepoints self.gradepoints credits
if grades C:
self.gradepoints self.gradepoints credits
if grades D:
self.gradepoints self.gradepoints credits
else:
self.gradepoints self.gradepoints credits
self.gpa selfgradepointsselfcredits
def getGPAself:
printfThe GPA for selffirstnameselflastname is selfgpa
# Prompt the user for the first and last name of the student
firstname inputEnter the first name of the student:
lastname inputEnter the last name of the student:
# Create a student object
student Studentfirstname, lastname
quit
while quit :
# Prompt the user for the grades and credits of the student
grades inputEnter the grade of the student:
credits intinputEnter the credits of the student:
student.calculateGPAgrades intcredits
quit inputEnter to continue or to quit:
student.getGPA
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
