Question: Task 1 (7 Points) You are responsible to make a list of students and employees. Students have to be enrolled one by one in a
Task 1 (7 Points) You are responsible to make a list of students and employees. Students have to be enrolled one by one in a Study program. Employees have a department of IMC as their employer. Create a Python file person.py. In the person.py file define several global variables and functions for the following tasks: 1) Define lists for saving students and employees 2) Define a function calculateAge (dateof Birth ) that calculates age based on the dateofBirth 3) Define a function enroll (name, age, studyprogram) that adds the student's name, age, studyProgram as a tuple in the students list. 4) Define a function student (name, dateof Birth, studyprogram) that enrolls the student and prints a message (see below). This function uses functions defined in 1) and 2). 5) Define a function employer (name, age, department) that adds the employee's name, age, department as a tuple in the employees list. 6) Define a function employee (name, dateof Birth, department) that adds the employee in the list and prints a message (see below). This function uses functions defined in 1) and 5). 7) Define a function getstudents () that returns a list of students. 8) Define a function getEmployees () that returns a list of employees. Create a Python file admission.py. In this file use the functions defined in the file person.py by importing the person. py in admission.py. Perform operations i) enroll students ii) add employees iii) print lists of students and iv) print list of employees
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
