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:


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


SSN: 123123123


Phone: 111-222-3333


Email: mike@g'mail.com


Salary: $6000


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


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


SSN: 123123111


Phone: 111-222-4444


Email: [email protected]


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:




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


SSN: 123123123


Phone: 111-222-3333


Email: [email protected]


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:


    ------------------------ Employee 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 DayAug 23, 2021

Answer To: Utilize looping to make your Python script for Functionality 2 (developed in Week 2) to run...

Konganapalli answered on Aug 30 2021
153 Votes
employeemangsystem/check.txt
steven smith,123123133,111-222-4444,[email protected],7000
Sara Smith,123123111,111-222-4444,[email protected],6500
employeemangsystem/e1.PNG
employeemangsy
stem/e2.PNG
employeemangsystem/e3.PNG
employeemangsystem/e4.PNG
employeemangsystem/e5.PNG
employeemangsystem/employee.py
import sys
employees=[]
def addEmployee():
    """
    This function will take employee information from user and store it in employees list
    """
    name=input("\nEnter employee name: (Example Mike Smith) ")
    ssn=input("\nEnter employee ssn: (Example 123123123) ")
    phone=input("\nEnter employee phone: (Example 111-222-3333) ")
    email=input("\nEnter employee email: (Example mike@g'mail.com) ")
    salary=input("\nEnter employee salary: (Example 6000) ")
    employees.append([name,ssn,phone,email,salary])
def viewEmployee():
    """
    This function view all employees information employees list
    """
    for employee in employees:
     print("\n---------------------------- "+employee[0]+" -----------------------------\nSSN: "+employee[1]+"\nPhone: "+employee[2]+"\nEmail: "+employee[3]+"\nSalary: $"+employee[4]+"\n------------------------------------------------------------------------\n")
def searchEmployee():
    """
    This function will take ssn information from user and search it in employees list
    """
    ssn=input("Enter SSN number: ")
    flag=False
    for employee in employees:
        if employee[1]==ssn:
            flag=True
            print("\nWe found an employee.Please see the details below\n")
            print("\n---------------------------- "+employee[0]+" -----------------------------\nSSN: "+employee[1]+"\nPhone: "+employee[2]+"\nEmail: "+employee[3]+"\nSalary: $"+employee[4]+"\n------------------------------------------------------------------------\n")
    if flag==False:
        print("\nSorry we are unable to find employee\n")
def...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here