Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python Program Input section: Instead of using a static list and the zip() method, you will receive input from the end user (again this is

Python Program

Input section:

Instead of using a static list and the zip() method, you will receive input from the end user (again this is you, LOL). You will take that information and apply it to a list with the elements being tuples. You will ask for user input with the following question: What is your first name? What is your last name? What year were you born? Your program should ask the end user for at least 5 employees and include at least 2 employees that will cause a duplicate username that your new logic will correct.

You will need to validate the data as to length. First and Last Name should be at least a length of 2. Year of birth should be a length of 4 but can remain a string. After each employee has entered their first name, last name and year of birth, you should display that information back out to the employee and ask them to confirm the information. If the employee answers Yes then update the employee data list with the information. If the employee answers No then clear the input variables and ask the questions again. After your program receives information on 5 employees, you will terminate the input process.

Process section:

With in a for in loop do the following: 1. Use that information to create employee usernames in the following format: first initial last name year of birth i.e. Dale Fontenot 1963 = dfontenot63 2. Use if else logic to test the new username to make sure it does not exist in the current username list. If it is a duplicate, do not append the username list but build a new username using the employees first name (all lower case) and the first initial of the last name and then the year of birth, ie dalef63. After building the new username, append the username list with it. If no duplicate is found, append the username to the username list. 3. Store the usernames in a list 4. Store the combined employee information in a dictionary with the username as the key and a tuple with first name, last name, year of birth. Make a copy of the username list without a copy loop and then sort that copy.

Output section:

You must then output the following information in this order:

Username

Todays Date

Employee Data list that you used to gather user input

Username list with all usernames

Employee data dictionary

Username list that has been sorted

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

What factors affect occupational accidents?

Answered: 1 week ago