Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

THE DIRECTIONS CALL FOR IF A DUPLICATE NAME IS FOUND A NEW USERNAME FORMAT IS NEEDED FOR THE ITEM THAT IS A DUPLICATE. NONE OF

THE DIRECTIONS CALL FOR IF A DUPLICATE NAME IS FOUND A NEW USERNAME FORMAT IS NEEDED FOR THE ITEM THAT IS A DUPLICATE. NONE OF THE PREVIOUS RESPONDERS ARE SOLVING THE PROBLEM!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
1
9
6
3
=
dfontenot
6
3
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 employee
s first name
(
all lower case
)
and the first initial of the last name and then the year of birth, ie dalef
6
3
.
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
Today
s 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

Decisions Based On Data Analytics For Business Excellence

Authors: Bastian Weber

1st Edition

9358681683, 978-9358681680

More Books

Students also viewed these Databases questions

Question

3. Contrast relational contexts in organizations

Answered: 1 week ago

Question

2. Describe ways in which organizational culture is communicated

Answered: 1 week ago

Question

1. Describe and compare approaches to managing an organization

Answered: 1 week ago