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 describeself that will print all attributes of the object in the format described in # below
Define the class Studentathlete as a subclass of Student
The class Studentathlete will inherit all the attributes and methods of Student and also contain its own method describeself that will print all attributes of the object in the format described in # below and also add the word "athlete", as given in # below
Create an object Student that is an instant of the class Student, using the init constructor. Use your own name, lastname, major and student class standing eg freshman, sophomore, junior, year
Print all attributes of the object Student using the describeself method
The output of the program should look similar to this: Helen Smith CIS Senior
Create an object Student that is an instance of the subclass Studentathlete
Print all the attributes of Student using its own describeself method. The output would look like this: John Smith CIS Senior Athlete
Test your solution. The output should provide all attributes of the object student and student 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
