Question

In: Computer Science

This week you will utilize various variable and functions to develop the first functionality for the...

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:

  • An explanation of how you used variables, functions, selection, and/or repetition to build your Python script for Functionality 1.
  • A brief description of the purpose of this functionality or what this program does.
  • The script for this functionality .

Solutions

Expert Solution

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:

  1. User is prompted to provide their inputs through a function take_input(), we have modularized the code piece which takes the prompt text and asks for the user to provide a value, which is then returned and stored in respective variables (line no. 17- 21).
  2. Next, in order to print the received value in the respective variable from step 1. We wrote another function print_user_input() and print_employeeName() to take label of the variable (namely Name, Phone etc.) and value of variable itself (line no. 24-30).
  3. Overall the functionality of the program is to receive user inputs and print them her we also demonstrate the application of functions to neatly write and manage code.

Related Solutions

Problem Description You have been asked to develop basic Event Broker functionality for a piece of...
Problem Description You have been asked to develop basic Event Broker functionality for a piece of home automation software. Your system needs to: Subscribe event handlers to handle different types of events when they occur Unsubscribe event handlers that no-longer need to handle specific events Receive emitted events Handle events by calling subscribed event handlers Events & Handlers: Each event has a type Event handlers may subscribe to be handle events of a given type An event handler can handle...
You may utilize the same person you interviewed in week 1 to continue your assignment. When...
You may utilize the same person you interviewed in week 1 to continue your assignment. When was the last time you purchased renter’s/homeowner's and/or automobile insurance? What would you do differently next time you purchase such insurance? Explain with specific details. Consult with your interviewee to find if there were any changes since your last purchase or policy review? If you did not purchase or have a policy review please consult with the instructor. Ask the interviewee to help prepare...
With the above information, you should be able to develop the following functions:
  Race Performance CompanyMonth Qty Costs(000) Sales(000)Jan 15000 1250 2340Feb 16400 1620 1952Mar 13625 1467 1675Apr 13020 1585 2102May 17025 1652 2054Jun 11250 1340 1875Jul 12345 1236 1457Aug 18024 1784 1640Sep 14695 1565 1987Oct 16874 1675 2014Nov 19785 1895 2650Dec 20102 1874 2540With the above information, you should be able to develop the following functions:1. Format Costs and Sales columns in $ with two decimal points.2. Format Qty with regular numbers with no decimal points.3. Centralize all the Titles4. Divide...
Week 2 Tasks This week, you will develop a needs statement, which provides factual information for...
Week 2 Tasks This week, you will develop a needs statement, which provides factual information for understanding the health problem. A problem statement is one of the most crucial parts of your concept paper. This is the first section your audience will read, and it will set the tone for your proposed program. A well-written problem statement should include the nature of the problem, who the problem affects, the current impact of the problem, and future consequences of the problem,...
Develop estimated regression equations, first using annual income as the independent variable and then using household...
Develop estimated regression equations, first using annual income as the independent variable and then using household size as the independent variable. Which variable is the better predictor of annual credit card charges? Discuss your findings - Income ($1000s) Household Size Amount Charged ($) 54 3 4,016 30 2 3,159 32 4 5,100 50 5 4,742 31 2 1,864 55 2 4,070 37 1 2,731 40 2 3,348 66 4 4,764 51 3 4,110 25 3 4,208 48 4 4,219 27...
Develop estimated regression equations, first using annual income as the independent variable and then using household...
Develop estimated regression equations, first using annual income as the independent variable and then using household size as the independent variable. Which variable is the better predictor of annual credit card charges? Discuss your findings - Income ($1000s) Household Size Amount Charged ($) 54 3 4,016 30 2 3,159 32 4 5,100 50 5 4,742 31 2 1,864 55 2 4,070 37 1 2,731 40 2 3,348 66 4 4,764 51 3 4,110 25 3 4,208 48 4 4,219 27...
Complete the project functions for this week. These functions are winner(), save_game() and load_game(). To complete...
Complete the project functions for this week. These functions are winner(), save_game() and load_game(). To complete these functions, first remove the library function call from the function in the template (save_game_lib, etc), then replace that with your own code to complete the function. You can test your functions separately from the project by creating a small main() function that calls them (with appropriate inputs), or you can compile the entire project and see if it works. winner(): The winner function...
Choose one or more nursing theories and utilize it (them) to develop a curriculum framework for...
Choose one or more nursing theories and utilize it (them) to develop a curriculum framework for a nursing program and explain the rationale for the framework. Describe how the framework will be used in the curriculum.
What is a political party? What are the various functions of parties? Which of these functions...
What is a political party? What are the various functions of parties? Which of these functions do you find most important and why? Provide examples and even reference personal experiences if applicable.
The homework assignment this week requires you to prepare various journal entries for a series of...
The homework assignment this week requires you to prepare various journal entries for a series of transactions involving sales transactions, estimations for bad debts expense, and estimated warranty obligations. Remember – the only way to lose points is to leave something blank. Take your best shot even if you are NOT really sure. The Professor sold rubber life rafts with a full cash refund if they sunk within a year after the purchase. During the first year 300 rafts were...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT