Sehnj K.

asked • 07/01/20

Python programming

This week's project is to extend the Employee class and its subclasses to create a Company class structure. A company consists of Teams, and each team contain a group of employees. In this group there are different type of employees: regular employees, developer, manager, so on.

1) Create a new class named Team. This class should contain a string attribute Name, which is the name of the team. This class also contains a list of Employee objects. It also contains a Manager object.

2)Add class methods Print_teamMembers() to Team class that will print the full info of the team employees.

3)Add PrintDevelopers() method to Team. This method finds all employees who are Developers and print their full name.

4)Create a class named Company. It should contain a list of teams.

5)Add PrintTeams() method to Company class. This method prints the name of all the teams in the company.

6)Create a "class" method that keeps track of number of employees in the company. Similarly create a "class" method that keeps track of number of employees in a team.

All the above code should be in a python module named Company.py.

Create a python file named TestCompany.py. Here you should import Company module. In there you should have a main() function in which you do the following:

Attached to this project is a text file employees.txt. It contains information about a company: its name is first row, its teams names are in second row, and the rest is the info for each employee of the company. The format is : "firstname lastname role team". "role" means which of the 3 possible roles the person has in the company (Employee , Developer, Manager). "team" means what team he/she belongs to.

Read the file and use the data to build the company. You have to use the techniques we learned so far how to read a text file line by line and use the info to setup the company object.

7) Write a method QueryEmployee(name) that will search for an employee in the company using his/her name.

#This is a test file for assigment Company posted on moodle. It contains the info needed to setup a Company object.

#It contains the name of all employees and their role and the team they belong to.

CompanyName: BuildTeamEnterprise

Teams: HR Project1 Project2

John Smith Employee HR

Sherri Jones Employee HR

Ali Travolta Developer Project1

James Brown Employee Project1

Sam Harris Employee Project1

Jennifer Adachi Manager Project1

Nina Simon Developer Project1

Nadia Comanchi Developer Project2

Jack Bear Employee Project2

Shaun Gordon Developer Project2

Aida Howe Manager Project2

Rose Chang Employee Project2


1 Expert Answer

By:

Ronke O. answered • 07/01/20

Tutor
4.9 (30)

M.S. in Computer Science; Experience Teaching 300+ Students

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.