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...

1 answer below »
Please read attachment carefully instructions and codes are located inside, this is a continuation of previous work


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 brief 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 brief description of the purpose of this functionality. · The script for this functionality. The Employee Management System – Functionality 3 Paper · 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 paper · Student’s name · Course name and number · 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 number 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): break 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'(\1)\2-\3', 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])
Answered Same DayMar 10, 2021

Answer To: For this assignment, you will · Utilize looping to make your Python script for Functionality 2...

Neha answered on Mar 10 2021
161 Votes
77377 - emp fuctions/employee.py
import re
counter=2
emp_dict = {
1: "Mark, 123M, (111)222-3333, [email protected], $60000",
2: "Jones, J122, (222)333-444
4, [email protected], $5000"
}
def AddEmp(i):
print("-----Employee ",counter,"-----")
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'(\1)\2-\3', str(employeeNumber))
employeeEmail = input("Enter email: ")
employeeSalary = float(input("Enter salary: "))
print('---------------------------------------------')
info = employeeName+', '+employeeSSN+', '+str(phoneNumber)+', '+employeeEmail+', $'+str(employeeSalary)
emp_dict[counter] = info
def ViewEmp():
userInput = int(input("Please enter index value to view employee's information: "))
print(emp_dict[userInput])

while(True):
print(f'There are {counter} employees in the system')
print('1. Add information about employee')
print('2. View information about employee')
print('0 to exit')
choice = int(input('Select one of the options: a'))
if (choice == 0):
break
elif (choice == 1):
counter = counter+1
AddEmp(counter)
elif (choice == 2):
ViewEmp()
else:
print('Invalid choice')

77377 - emp fuctions/report.docx
CPT200: Fundamentals of Programming Languages
Dr. Amjad Alkilani
March 4, 2021
Screenshot of running program
Variables Used in Program
employeeName = This variable is used to...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here