For this assignment, you need to submit a Python program that gathers information about instructors and students according to the rules provided:

  • What type of individual we're dealing with (instructor or student)
  • If the individual is a student, we need to get their Student ID (this is required, and must be a number that is 7 or less digits long)
    • We also need to obtain their program of study (this is required)
  • If the individual is an instructor, we need to get their Instructor ID (this is required, and must be a number that is 5 or less digits long)
    • We also need to obtain the name of the last institution they graduated from (this is required) and highest degree earned (this is required)
  • The individual's name (this is required, and must be primarily comprised of upper- and lower-case letters. It also cannot contain any of the following characters: ! " @ # $ % ^ & * ( ) _ = + , < > / ? ; : [ ] { } \ )
  • The individual's email address (this is required, and must be primarily comprised of alphanumeric characters. It also cannot contain any of the following characters: ! " ' # $ % ^ & * ( ) = + , < > / ? ; : [ ] { } \ ).

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.

Practice and Lecture Problems

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.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.