question archive For this assignment, continue to use variables, functions, and control structures to improve the "View all Employees" functionality developed in Week 3 and utilize functions and the passing of parameters to add two new functionalities to the Employee Management System

For this assignment, continue to use variables, functions, and control structures to improve the "View all Employees" functionality developed in Week 3 and utilize functions and the passing of parameters to add two new functionalities to the Employee Management System

Subject:Computer SciencePrice:6.89 Bought3

For this assignment, continue to use variables, functions, and control structures to improve the "View all Employees" functionality developed in Week 3 and utilize functions and the passing of parameters to add two new functionalities to the Employee Management System.

 

Update the "View all Employees" functionality developed in Week 3 to view the result in the following format:

 

---------------------------- Mike Smith -----------------------------

 

SSN: 123123123

 

Phone: 111-222-3333

 

Email:

 

Salary: $6000

 

------------------------------------------------------------------------

 

---------------------------- Sara Smith -----------------------------

 

SSN: 123123111

 

Phone: 111-222-4444

 

Email:

 

Salary: $6500

 

------------------------------------------------------------------------ 

 

Now continue to employ the list data structure and utilize functions to add the following two new functions:

 

  • Search employee by SSN: This functionality makes use of looping and string parsing to search all the employees in the list and returns the information of the employee who has a SSN similar to the one that the user provided. The system should display the employee information in the following format:

 

---------------------------- Mike Smith -----------------------------

 

SSN: 123123123

 

Phone: 111-222-3333

 

Email:

 

Salary: $6000

 

------------------------------------------------------------------------

 

  • Edit employee information: This functionality makes use of the "Search employee by SSN" function first to find the right employee, then it will allow the user to edit the information of the selected user.

 

Once completed Functionality 4, provide the following in a Word document.

 

  • One screen shot of each completed functionality.
  • An explanation of how variables, functions, and control structures were used to improve the "View all Employees" functionality to view results in the format provided.
  • An explanation of how you employed the list data structure to add the two new functions, "Search employee by SSN" and "Edit employee information."
  • A brief description of the purpose of this functionality.
  • The script for this functionality.

 

My Functionality 3 was:

# function to add employee (functionality 1)

def addEmployee():

 employeeName = input("nEnter Employee Name: ")

 employeePhone = input("Enter Employee Phone Number: ")

 employeeSSN = input("Enter Employee SSN: ")

 employeeEmail = input("Enter Employee Email: ")

 employeeSalary = input("Enter Employee Salary: ")

 employeeInfo = []

 employeeInfo.append(employeeName)

 employeeInfo.append(employeePhone)

 employeeInfo.append(employeeSSN)

 employeeInfo.append(employeeEmail)

 employeeInfo.append(employeeSalary)

 return employeeInfo

# function to view all employees (functionality 2)

def viewAllEmployee(employees):

 if len(employees) == 0:

  print("nThere is no employeesn")

 else:

  print("n")

  for employee in employees:

   print("nEmployee "+str(employees.index(employee)+1)+" details:")

   print("tEmployee_Name:",employee[0])

   print("tPhone:",employee[1])

   print("tSSN:",employee[2])

   print("tEmail:",employee[3])

   print("tSalary:",employee[4])

   print("n")

# Main (functionality 3)

employees = []

employeeCount = 0

while True:

 print("1. Add Employeen2. View all Employeesn3. Exit")

 choice = int(input("nEnter a choice (1/2/3): "))

 if choice == 1:

  info = addEmployee()

  employees.append(info)

  employeeCount += 1

  print("n"+str(employeeCount)+" employee's information is addedn")  

 elif choice == 2:

  viewAllEmployee(employees)

 elif choice == 3:

  break

 else:

  print("nInvalid choice. Please Try again...n")

Option 1

Low Cost Option
Download this past answer in few clicks

6.89 USD

PURCHASE SOLUTION

Option 2

Custom new solution created by our subject matter experts

GET A QUOTE

rated 5 stars

Purchased 3 times

Completion Status 100%

Related Questions