100%(14)14 out of 14 people found this document helpful
This preview shows page 1 - 4 out of 4 pages.
Professor Amjad AlkilaniStudent: Christopher Larson-2020CPT 200Week 2 AssignmentEmployee Management System – Functionality 2
I started with an empty list called employees and a static integer of 5. The while loop iterates through adding employee traits to variables and storing them in a separate list. I then add that list to the employees list, essentially creating a list of lists and then decrement the static integer before going through the loop again until the integer is 0. I then enter a loop looking for an inputted value to be ‘q’ or ‘Q’ and if it is not then I look for a valid index between 1 and 5 to lookup the employee information. However, because list indexes start at 0 I have to subtract 1 from the entered lookup integer to get the correct index. If an incorrect index is entered, for example 6, then an error message is displayed and the user must input another number or exit the program with ‘q’ or ‘Q’. If a correct index is entered then the employee information is displayed and another index or quit command can be entered.