For this assignment, you will
· Utilize looping to make your Python script for Functionality 2 (developed in Week 2) to run constantly.
· Separate Functionality 1 (developed in Week 1) into the following two functionalities:
· Add Employee – this functionality will allow users to add new employee to the system.
· View all Employees – this functionality will view all employees in the system.
· Use global variables to develop a counter to keep track of the number of employees in the system. A good employee management system should always give
ief information about the existing number of employees. This counter can be shown to the user when they run the script as the following message:
There are (3) employees in the system.
Once you have completed Functionality 3, you must provide the following in a Word document and submit it through the Waypoint grading system:
· One screen shot of the completed functionality.
· An explanation of how you utilized looping to make the Python script for Functionality 2 run constantly. Paragraph format.
· A description of how you separated Functionality 1 into two functionalities.
· An explanation of how you used global variables to develop a counter to keep track of the number of employees in the system.
· A
ief description of the purpose of this functionality.
· The script for this functionality.
The Employee Management System – Functionality 3 Pape
· Must include a screen shot of Functionality 3 input function and outputs
· Must include an attached zip folder that contains a running source code for Functionality 3.
· Must include a separate title page with the following:
· Title of pape
· Student’s name
· Course name and numbe
· Instructor’s name
· Date submitted
Variables used:
employeeName = This variable is used to store in employee name
employeeSSN = This variable is used to store in employee SSN
employeeNumber = This variable is used to store in employee numbe
employeeEmail = This variable is used to store in employee email
employeeSalary = This variable is used to store in employee salary
phoneNumber = This variable is used to store phone number in proper format
i = This variable is used to execute the loop
emp_dict = This variable is used to create the dictionary for storing employee’s information using index
Functionality Week 1
Code:
employeeName = input("Enter name: ")
employeeSSN = input("Enter SSN: ")
employeeNumber = int(input("Enter phone number: "))
employeeEmail = input("Enter email: ")
employeeSalary = float(input("Enter salary: "))
#print the formatted employee details
print(f"---------------------------- {employeeName} -------------------")
print("Name: "+employeeName)
print("SSN: "+employeeSSN)
print("Phone Number: "+str(employeeNumber))
print("Email: "+employeeEmail)
print("Salary: $"+str(employeeSalary))
print(f"---------------------------------------------------------------")
Functionality Week 2:
Code:
import re
emp_dict={}
i=0
while(True):
if(i==5):
eak
print("-----Employee ",i+1,"-----")
employeeName = input("Enter name: ")
employeeSSN = input("Enter SSN: ")
employeeNumber = int(input("Enter phone number: "))
phoneNumber = re.sub(r'(\d{3})(\d{3})(\d{4})', r' XXXXXXXXXX', str(employeeNumber))
employeeEmail = input("Enter email: ")
employeeSalary = float(input("Enter salary: "))
print('---------------------------------------------')
i = i+1
info = employeeName+', '+employeeSSN+', '+str(phoneNumber)+', '+employeeEmail+', $'+str(employeeSalary)
emp_dict[i] = info
userInput = int(input("Please enter index value to view employee's information"))
print(emp_dict[userInput])