Question: Write a Python program that will do the following: Define the class Student The class Student will contain these four attributes: firstname, lastname, major, year

Write a Python program that will do the following:
Define the class Student
The class Student will contain these four attributes: firstname, lastname, major, year
The class Student will contain a constructor method __init__() that will initialize the above attributes
The class Student will also contain a method " describe_self()" that will print all attributes of the object in the format described in #9 below
Define the class Student_athlete as a subclass of Student
The class Student_athlete will inherit all the attributes and methods of Student and also contain its own method " describe_self()" that will print all attributes of the object in the format described in #9 below and also add the word "athlete", as given in #11 below
Create an object Student1 that is an instant of the class Student, using the __ init__() constructor. Use your own name, lastname, major and student class standing (e.g. freshman, sophomore, junior, year)
Print all attributes of the object Student1 using the describe_self() method
The output of the program should look similar to this: Helen Smith CIS Senior
Create an object Student2 that is an instance of the subclass Student_athlete
Print all the attributes of Student2 using its own describe_self() method. The output would look like this: John Smith CIS Senior Athlete
Test your solution. The output should provide all attributes of the object student1 and student 2. Submit the code by pasting it here. Use a monospaced font. Make sure the indentation appears exactly as in your program. In Python

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!