In: Computer Science
This week you will utilize various variable and functions to develop the first functionality for the Employee Management System Project. For this assignment, write a Python script to allow users to enter the following string values: employeeName, employeeSSN*, employeePhone, employeeEmail, and employeeSalary.
*(employeeSSN = Employee Social Security Number. For example, 123121234)
Once you have entered your values, you should display it in the following format:
---------------------------- Mike Smith -----------------------------
SSN: 123123123
Phone: (111)222-3333
Email: mike@ g m a i l. com
Salary: $6000
----------------------------------------------------------------------------
Once you have completed Functionality 1, you must provide the following in a Word document:
CODE:
# function to take user input with prompt text and return
# user provide value back to the caller
def take_input(inptText):
return input(inptText)
# function to print user variable along with the label of the variable
def print_user_input(label,val):
print("{} : {}".format(label,val))
# function to print the employee name specifically
def print_employeeName(empName):
print("-------------------------- {} -----------------------".format(empName))
# call the take_input function and store the user
# provided values at the runtime
employeeName=take_input("Enter Employee Name")
employeePhone=take_input("Enter Employee Phone Number")
employeeSSN=take_input("Enter Employee SSN")
employeeEmail=take_input("Enter Employee Email")
employeeSalary=take_input("Enter Employee Salary")
# print the employee name title section
print_employeeName(employeeName)
# print the user entered value along with their respective labels
print_user_input("SSN",employeeSSN)
print_user_input("Phone",employeePhone)
print_user_input("Email",employeeEmail)
print_user_input("Salary","$"+employeeSalary.replace("$",""))
# end of the structure
print("------------------------------------------------------------")
RESULT:
CODE SNIPPET:
EXPLANATION:
With the reference of CODE SNIPPET piece above: