Question: PLEASE NOTE THE VARIABLE FUNCTION PART IS ASKING FOR USERNAME TO BE CREATED FROM: WHICH HAS NOT BEEN DONE CORRECTLY FOR ANY CHEGG RESPONSES Process
PLEASE NOTE THE VARIABLE FUNCTION PART IS ASKING FOR USERNAME TO BE CREATED FROM:
WHICH HAS NOT BEEN DONE CORRECTLY FOR ANY CHEGG RESPONSES
Process section:
With in a for in loop do the following:
Use that information to create employee usernames in
the following format: first initial last name year of
birth ie Dale Fontenot dfontenot
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 dalef After building
the new username, append the username list with it If
no duplicate is found, append the username to the
username list.
Input section:
Add logic to the input section that will add additional
questions about password construction.
How long do you want your password? Length must be between
and in length.
Do you want special characters in your password?
Do you want numbers in your password?
You will validate the password length the user entered and
make sure it is at least but not greater than and that
it can be converted to an integer.
You will add the new input to the employee data list for
later processing.
Classes needed: in separate py files
Person class:
Properties: first name, last name, birthyear
Methods: greet person that returns a message and age that
will return a persons age in years based on the current year
Employee class:
Will inherit from the Person class
Properties: password length, use special characters flag, use
numbers flag
Methods: build password that will take the properties and
create a password that will be of the requested length and
have special characters and numbers if the employee request
them.
Process section:
Gather the data entered in a list with the elements being of
type tuple containing first name, last name, birthyear this
Add a function under the variable section to generate a
username. see example below This function will take the
first name, last name and year of birth as parameters along
with a duplicate found flag. The duplicate found flag will
be used in the functions if else logic to generate the
correct type of username. You will then pass the username
back out to the function call.
After the creation of the username, instantiate a copy of the
employee class and pass all the employee data to it including
first name, last name, birth year, password length, use
special characters flag, and use numbers flag.
Within the person class you will create a message and
calculate the persons age in years and store that
information in a list to be printed out in the output
section. In the employee class which should inherit from
person you will generate a password of required length and
use special characters and numbers if the employee has
requested. Pass the password back to your main program.
Create a list with the following data in it and add it to the
Employee data dictionary INSTEAD of the content of the
employee tuple. Use the username as the key and a tuple as
the value with the following data: first name, last name,
year of birth, password in a lis
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
