Question: Advanced level school Python programming. Need helps. A school wants to use Object-Oriented Programming (OOP) to model the staff working in the school. The Staff

 Advanced level school Python programming. Need helps. A school wants to

use Object-Oriented Programming (OOP) to model the staff working in the school.

Advanced level school Python programming. Need helps.

A school wants to use Object-Oriented Programming (OOP) to model the staff working in the school. The Staff class will store the following data: - Name: STRING - Date: STRING with 8 digits representing the date the staff joined the school in DDMMYYYY format. For example, 20062015 represents 20 June 2015. The Staff class will have the following methods: - display_name (): displays a string which is a unique identifier constructed as follows: _, where is the year the staff member joined the school. For example, "John Tan_2016". - length_of_service (): returns the number of years (rounded down) that the staff has worked at this school compared against the system's date. Task 1.1 Write program code to define the Staff class. The Teacher class inherits from Staff. The Teacher class will store the following additional data: - Classes_taught: STRING that contains the two classes taught by the teacher and the following methods: - display_name () displays a string which is a unique identifier constructed as follows: __. For example, "1SA4_1SB8_Peter Lim_2018". This method overrides display_name () in the parent class. Task 1.2 Write program code to define the Teacher class. The text file Teachers_info.txt stores detail regarding every teacher in the following format: , , , The data contained in Teachers_info.txt should conform to the following specification: - Name: The first character of every distinct word in the name is capitalized. It should only contain letters and spaces, and there are no digits or punctuation. Example: Lim Ann Lynn - Subj_class: 4-character string beginning with either 1 or 2 , followed by two capital letters and ending with a digit between 1 and 9. Example: 1PH4 Subj_class1 and Subj_class2 follow the same format. - Date: 8-digit string representing the date the staff joined the school in DDMMYYYY format. The date should be a valid date. January, March, May, July, August, October and December have 31 days; April, June, September and November have 30 days; February has 29 days if the year is a multiple of 4 , and 28 days otherwise. The year should be between 1970 and 2021 (both inclusive). Task 1.3 Write code to: - Check that the data contained in Teachers_info.txt conforms to the above specified format. - Write all error free entries to the file Teachers_validated.txt - Create a Teacher object for every teacher with valid information - Create a list of all the Teacher objects created

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!