Question: Create a file called basic_classes.py. In that file, write the following classes with appropriate fields and methods. For each class definition, create two example instances

 Create a file called basic_classes.py. In that file, write the following
classes with appropriate fields and methods. For each class definition, create two

Create a file called basic_classes.py. In that file, write the following classes with appropriate fields and methods. For each class definition, create two example instances of that class, and demonstrate the functionality of at least one of the methods. The class "Circle" with the following attributes: Fields: 1. color (string), and 2. radius (float) Methods: 1. diameter() which calculates the diameter of the circle (you can use math.pi or just 3.14) 2. circumfrence() which calculates the circumference of the circle. 3. isRed() which returns True if this circle is red. The class "Graduate Student" with the following attributes: Fields: 1. first_name (string), 2. last_name (string), 3. year (integer), and 4. major (string) Methods: 1. year_matriculated () which, given that it is January 2020, returns the year that the student began studying. So, if the student's year is 1, then year_matriculated() should return 2019. If their year is 5, then year_matriculated() should return 2015

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!