Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Use Python 3 please: Also use functions when needed Implement a python script that will create a Dictionary of records representing a number of users
Use Python 3 please: Also use functions when needed
Implement a python script that will create a Dictionary of records representing a number of users who have requested access to one or more of the servers you manage as a System Administrator. Ideally, this might be implemented as an online form, but we are going to assume we have the information in some other form such as an email response. Imagine that our program commits those records to a database or other permanent storage. For now, we will just print a summary report. In a loop, the program will prompt the user (which is you) for a series of values which you will store in a Dictionary. As you start a new record, add the employee ID as an Integer to the Dictionary to act as the key. You should ensure that the employee ID has no duplicates (validate employee ID) . The value stored will be a List. By the end of the series of prompts, the program will have added the full record to a Dictionary. It will then ask if you want to enter another user record. If you answer "yes" or "Y" the program continues to prompt for the next record. If you enter anything other than "yes" or "Y" it will move to the next phase, which is to print a summary of all user records created in this run of the program. Your responses to the prompts are shown in bold font in the sample run below. The following is a sample run of the program with 3 records entered. When you test, create different numbers of records to be sure that it works correctly for 1 to n records. You can assume the user always creates at least one user record. or Y to Sample ./create_user_records.py Enter the user's employee id: 589 Enter the user's first name: John Enter the user's last name: Smith Enter the user's department number: 42 Enter the user's supervisor (full name) : Hank Jones Enter the user's Linux account ID: smithji Enter the user's temporary password: HOlyMoses Would you like to create another record (type yes continue): Y Enter the user's employee id: 472 Enter the user's first name: Jane Enter the user's last name: Doe Enter the user's department number: 54 Enter the user's supervisor (full name): Art Tatum Enter the user's Linux account ID: doeji Enter the user's temporary password: $ecrEtWord Would you like to create another record (type yes or continue): Y to Enter the user's employee id: 467 Enter the user's first name: John Enter the user's last name: Doe Enter the user's department number: 42 Enter the user's supervisor (full name): Hank Jones Enter the user's Linux account ID: doej2 Enter the user's temporary password: Obfu$ction Would you like to create another record (type yes or Y to continue): N Summary Report of User Records II 3 records created: Name : John Smith Employee Id: 589 Department: 42 Supervisor: Hank Jones Username: smithj1 Password: HOlymo$es Name: Jane Doe Employee Id: 472 Department: 54 Supervisor: Art Tatum Username: doeji Password: SecretWord Name: John Doe Employee Id: 467 Department: 42 Supervisor: Hank Jones Username: doej2 Password: Obfu$ction 1. The full set of records must be stored as a Dictionary in which the key is the employee ID and the value is a List. Validate employee ID 5pts 2. Other than the employee ID, all other fields are to be stored in an List of Strings under the employee ID key 5pts 3. Implement a function to capture user records and populate the dictionary using requirements 1&2 above. 15pts 4. Implement a function that displays a simple report with the general format and header as shown in the sample run 10pts 5. Do not hard-code the number of records or prompt the user to enter the number of records. 5pts 6. Provide meaningful comments at the block level. Zero comments, comments on every line, or extraneous trivial comments will result in a point deduction up to the full value allotted. 10pts
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