Employee Management System - Simple Project
The employee management system project is designed to take user input and store
the information as variables for later use. As Miller, Vahid, and Lysecky point
out, a variable “is used to remember a value for later use" (2015). Creating the
variables of employeeName, employeeSSN, employeePhone, employeeEmail, and
employeeSalary were to hold the information to display later in the program.
Variable types were string with the exception of the salary input that was set
as an integer.
Repetition was very useful in writing
this code. Each line was the same just changing the variable name and type in
the string. Employee salary was the only line that had an addition with the
sep= function to remove the space after the $ sign in the code. This was used
for appearance purposes. Setting the variables to strings allowed the user to
enter dashes if needed and parenthesis if desired for the phone number. Setting
the variables to integers produced an error code when entering any information
besides a number and wasn’t useful for the project.
The salary function could have been
set to float to show decimals, but the project directions were using whole
integers and should be set to int(). Screen shots are blow of the code and the
script is included in this document.
Code from Project
# this is the project
to enter employee information
# input for employee name
employeeName = str(input('Employee Name: '))
# input for employee SSN
employeeSSN = str(input('Employee SSN: '))
# input for employee Phone
employeePhone = str(input('Employee Phone Number: '))
# input for employee email
employeeEmail = str(input('Employee Email: '))
# input for employee salary
employeeSalary = int(input('Employee Salary: '))
# dispaly output as required
print("--------------------",employeeName,"--------------------")
print("SSN:",employeeSSN)
print("Phone:",employeePhone)
print("Email:",employeeEmail)
print("Salary: $",employeeSalary,sep="")
print("__________________________________________")
Comments
Post a Comment