Question: Could you please solve the following python script for me! Thank you! Implement a python script that will create a Dictionary of records representing a
Could you please solve the following python script for me! Thank you!
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.
Sample Run ./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: smithj1 Enter the user's temporary password: H0lyM0$es Would you like to create another record (type yes or Y to 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: doej1 Enter the user's temporary password: $ecrEtW0rd Would you like to create another record (type yes or Y to continue): Y 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: 0bfu$c8tion Would you like to create another record (type yes or Y to continue): N
Summary Report of User Records ============================= 3 records created: Name: John Smith Employee Id: 589 Department: 42 Supervisor: Hank Jones Username: smithj1 Password: H0lyM0$es Name: Jane Doe Employee Id: 472 Department: 54 Supervisor: Art Tatum Username: doej1 Password: $ecrEtW0rd Name: John Doe Employee Id: 467 Department: 42 Supervisor: Hank Jones Username: doej2 Password: 0bfu$c8tion Grading Rubric (Requirements) 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
Get step-by-step solutions from verified subject matter experts
