For this assignment, you need to submit a Python program that gathers information about instructors and students according to the rules provided:
Write your program such that if a user inputs any of the above information incorrectly, the program asks the user to re-enter it before continuing on. Your program should accept any number of individuals until the person using the program says they are done.
You will store the information you collect for each user in class instances that you will append to a list called "college_records". There will be an Instructor class and a Student Class (which should be pretty simple), and your submission must use inheritance principles. Create a method that displays all collected information for an individual called "displayInformation".
You must also create a class called "Validator" that has methods attached to it that validate submitted information.
When your submission is through gathering data, print out all entries in the college_records list.
Be sure to put comments in your code that clearly mark how you are performing your program logic.
Problem 1:
Make a class called Shirt. The constructor for this class should store two attributes, size and color. Create a method on your class called that prints the two attributes on the class out.
Create an instance of your Shirt class. Print each attribute of the class out individually. Then, call the method on the class that you wrote to print out the attributes.
Then, create a new instance of the Shirt class. Print each attribute of the class out individually. Then, call the method on the class that you wrote to print out the attributes.
Problem 2:
Modify your Shirt class (give it a new name) that adds an attribute called quantity that is set to a default value of 1.
Create two new methods on the class, one to increase the quantity attribute and one to decrease it. The increase function will add a passed number to the value of the quantity attribute. The decrease function will work in the reverse - passed numbers will be subtracted from the current value of the quantity attribute.
Create an instance of the new class and call the increase method three different times, using a different number each time. After calling the method, print out the value of the quantity attribute. Then, call the decrease function twice, using a different variable each time. After calling the method, you will again print out the value of the quantity attribute.
Problem 3:
Re-write the shirt class you created in problem 2 to be called "Clothing" instead. Create a new class called "ShirtInherit" that adds type information (short or long sleeves) as well as a printed message. Add a method to print out the current message on the shirt.
Create an instance of this and call the increase method with a number of your choosing. Print out the current value of the quantity attribute. Then, call the method you created to print out the message on the shirt.
Problem 4:
Extend the "Clothing" class you created in problem 3 to a class called "Pants". This class should add fabric type and style (dress, casual, jeans, etc.) to the base class.