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 __init__(self, first_name, last_name):
self.first_name = first_name
self.last_name = last_name
self.grade_points =0
self.credits =0
self.gpa =0
def calculateGPA(self, grades, credits):
self.credits = self.credits + credits
if grades =="A":
self.grade_points = self.grade_points +4* credits
if grades =="B":
self.grade_points = self.grade_points +3* credits
if grades =="C":
self.grade_points = self.grade_points +2* credits
if grades =="D":
self.grade_points = self.grade_points +1* credits
else:
self.grade_points = self.grade_points +0* credits
self.gpa =(self.grade_points)/(self.credits)
def getGPA(self):
print(f'The GPA for {self.first_name}{self.last_name} is {self.gpa}')
# Prompt the user for the first and last name of the student
first_name = input("Enter the first name of the student: ")
last_name = input("Enter the last name of the student: ")
# Create a student object
student = Student(first_name, last_name)
quit ='1'
while quit =='1':
# Prompt the user for the grades and credits of the student
grades = input("Enter the grade of the student: ")
credits = int(input("Enter the credits of the student: "))
student.calculateGPA(grades, int(credits))
quit = input("Enter 1 to continue or 2 to quit: ")
student.getGPA()

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!