Question
Can somebody solve this question for me? Using Python!!!!!!!!!!!!!!!!!!!! Can somebody solve this question for me? Using Python!!!!!!!!!!!!!!!!!!!! I am also attaching a screenshot of
Can somebody solve this question for me? Using Python!!!!!!!!!!!!!!!!!!!!
Can somebody solve this question for me? Using Python!!!!!!!!!!!!!!!!!!!!
I am also attaching a screenshot of what the sample output should look like, below:
Also I have created the employee class (mentioned in the question) and am pasting it below for easy access.
class Employee: def __init__(self, name = "", iDNumber = "", department = "", jobTitle = ""): self._name = name self._iDNumber = iDNumber self._department = department self._jobTitle = jobTitle def setName(self, name): self._name = name def setIDNumber(self, iDNumber): self._iDNumber = iDNumber def setDepartment(self, department): self._department = department def setJobTitle(self, jobTitle): self._jobTitle = jobTitle def getName(self): return self._name
def getIDNumber(self): return self._iDNumber
def getDepartment(self): return self._department
def getJobTitle(self): return self._jobTitle
def __str__(self): return self._name + " " + self._iDNumber + " " + self._department + " " + self._jobTitle
This question assumes that you have created the Employee class for question 2. Copy and paste the class you have created in question 2 to this question. Create a program that asks the user to input Employee Name, ID Number, Department, and Job Title of as many employees he/she wants. Then create an Employee object for each of them and add them to a dictionary. Use the employee ID number as the key. Create a main function in which user will be asked to select one of the following options. Based on what the user selects, run the associated function. In another words, the main program asks the user to select one of the following menu options by typing a number. Then the program asks the user to select from the menu again. This loop continues until the user select types number 4 (quit the program). For example, the user type 2 and the main function calls dic_add function and return the updated dictionary to the main and ask aske the user to select from the menu again (function 1,2,3 get the dictionary as an parameter). 1. Look up an employee in the dictionary (Function name: dic_lookup): This function look up an employee based on employee ID that the user input and print 2. Add a new employee to the dictionary (Function name: dic_add): Ask the user to type the information of a new employee and add it to the dictionary and 3. Delete an employee from the dictionary (Function name: dic_delete): Ask the user to input the employee ID of the employee to be deleted from the 4. Quit the program (No function for this option) all the information of that employee by using the class status representation method return the updated dictionary to the main. dictionary. The function will delete that employee from the dictionary and return the updated dictionary to the main
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started