Write a python class named Employee that holds the following data about an employee in attributes: name, ID number, department, and job title. Once you have written the class, write a PYTHON program that creates three Employee objects to hold the following data:
Employee Management System
Write a python class named Employee that holds the following data about an employee in attributes:
name, ID number, department, and job title. Once you have written the class, write a PYTHON
Name | ID Number | Department | Job Title |
Susan Meyers | 47899 | Accounting | Vice President |
Mark Jones | 39119 | IT | Programmer |
Joy Rogers | 81774 | Manufacturing | Engineer |
The program should store this data in the three objects, then display the data for each employee on the screen.
Using the Employee class, create a program that stores Employee objects in a dictionary. Use the employee ID number as the key.
The program should present a menu that lets the user perform the following actions:
• Look up an employee in the dictionary
• Add a new employee to the dictionary
• Change an existing employee’s name, department, and job title in the dictionary
• Delete an employee from the dictionary
• Print all employees in the dictionary
• Quit the program
When the program ends, it should pickle the dictionary and save it to a file. Each time the program starts, it should try to load the pickled dictionary from the file. If the file does not exist, the program should start with an empty dictionary.
Sample Input/Output:
Menu
----------------------------------------
1. Look up an employee
2. Add a new employee
3. Change an existing employee
4. Delete an employee
5. Print all employees
6. Quit the program
Enter your choice: 1
Enter an employee ID number: 47899
Name: Susan Meyers
ID number: 47899
Department: Accounting
Title: Vice President
Menu
----------------------------------------
1. Look up an employee
2. Add a new employee
3. Change an existing employee
4. Delete an employee
5. Print all employees
6. Quit the program
Enter your choice: 6
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 3 images