Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Looking for assistance on what I need to add/change so that a user can choose to add a new employee, view all employees, and see
Looking for assistance on what I need to add/change so that a user can choose to add a new employee, view all employees, and see how many employees are in the database. Currently I have it set to allowing a set input of five people, but looking for guidance on what i need to change to make it more, and not set to only five. Also if you can tell me what you added, and why its important that would be helpful.
employeeList = [] numEntires = 5 for idx in range(numEntires): print(f'Please fill out the employees information {idx+1}: ') name=input('Employee Name: ') try: ssn=int(input('Employee SSN: ')) except ValueError: print("SSN can only be a numeric value") sys.exit(1) phone=input('Employee Phone No.: ') email=input('Employee Email: ') try: salary=float(input('Employee Salary: $ ')) except ValueError: print("Salary can only be a floating point integer") sys.exit(1) employeeList.append([name, ssn, phone, email, salary]) index = int(input('Please enter the employee identification code or 0 to exit:')) while index != 0: if index > numEntires: print(f"Please enter an employee code between 1 and {numEntires}") continue employee = employeeList[index-1] print(f""" Employee Information System Name: {employee[0]} SSN: {employee[1]} Phone + Email: {employee[2]}, {employee[3]} Salary : ${employee[4]} 'end'""") index = int(input('Enter the employee identification code from 1-5 to access employee information:'))
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started