Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

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

1 answer below »
  • 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.

  • An explanation of how you utilized looping to make the Python script for Functionality 2 run constantly.

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

For this assignment, you will continue to use variables, functions, and control structures to improve the “View all Employees” functionality you developed in Week3 and utilize functions and the passing of parameters to add two new functionalities to your Employee Management System.

Update the “View all Employees” functionality you have developed in Week3 to view the result in the following format:

--------- XXXXXXXXXXMike Smith -----------------------------

SSN: XXXXXXXXXX

Phone: XXXXXXXXXX

Email: mike@g'mail.com

Salary: $6000

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

--------- XXXXXXXXXXSara Smith -----------------------------

SSN: XXXXXXXXXX

Phone: XXXXXXXXXX

Email: XXXXXXXXXX

Salary: $6500

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

Now you will 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. Your system should display the employee information in the following format:

--------- XXXXXXXXXXMike Smith -----------------------------

SSN: XXXXXXXXXX

Phone: XXXXXXXXXX

Email: XXXXXXXXXX

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 you have completed Functionality 4, you must provide the following in a Word document and submit.

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

  • You will now combine all the functionalities you have developed into one single application. Explain the steps you took to combine all of the functions into one single application

    The end product should look similar to the following:

    ----- XXXXXXXXXXEmployee Management System ---------------------------

    There are ( 5 ) employees in the system.

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

    1. Add new employee

    1. View all employees

    1. Search employee by SSN

    1. Edit employee information

    1. Export employees’ information into a text file

    1. Import employees’ information from a text file

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

    Please enter your option number:

    An explanation of the steps you took to combine all of the functions into one single application.

    • A brief description of the purpose of the Employee Management System.

    • The script for the final Employee Management system.



Answered Same Day May 26, 2021

Solution

Pritam answered on May 28 2021
160 Votes
counter = 0
lstEmployees = []
def addEmployee():
    global counte
    global lstEmployees
    counter += 1
    name = input('\nEnter employee name: ')
    ssn = input('Enter employee SSN: ')
    phone = input('Enter employee phone number: ')
    email = input('Enter employee email: ')
    salary = input('Enter employee salary: $')
    newEmployee = [ssn, name, phone, email, salary]
    lstEmployees.append(newEmployee)
    
def viewAllEmployees():
    global counte
    global lstEmployees
    if counter == 0:
        print("\nThere are cu
ently NO EMPLOYEES to display!")
    for employee in lstEmployees:
        print("\n\t----------------------- " + employee[1] + " -----------------------")
        print("\tSSN: \t" + employee[0])
        print("\tPhone: \t" + employee[2])
        print("\tEmail: \t" + employee[3])
        print("\tSalary:\t$" +...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here