Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create and call a function to: Open a text file for storing the user information. The file must be opened so that entered data is

  1. Create and call a function to:
    • Open a text file for storing the user information. The file must be opened so that entered data is added to the data already in the file.
    • Use a loop to read the current records from the text file and save the user ID into a list object for validation purposes.
  2. Create and call a function to use a loop that will obtain user input until terminated by the user typing “End.”
    • Allow the user to input a user ID, password, and authorization code. Validate that the user ID does not already exist in the list object and that only “Admin” or “User” is entered as an authorization code.
    • Write the user ID, password, and validation code as a pipe-delimited list to the text file and add the user ID to the list object if all validations have passed.
  3. After the user terminates the data entry loop, create and call a new function that will:
    • Open the text file that contains the user login information.
    • Display the user ID, password, and authorization code for all users.
  • Ensure all functionality is working correctly and code is written efficiently. For purposes of this assignment, writing code efficiently is defined as:
    • Using correct naming conventions for all variables and objects.
    • Using correct naming conventions for functions and methods.
    • Using built-in functions whenever possible.
    • Using the fewest lines of code needed to return multiple values from functions.
    • Using the fewest lines of code needed to complete the functionality defined.

Instructions for Existing Application

  1. Create and call a function for login process:
    • Open the text file with the user login information.
    • Read each record from the file and store the user ID, password, and authorization code in a list object. Note: Multiple list objects may be needed for this functionality.
    • Enter a user ID.
    • Enter a password.
    • Validate the user ID by reading the list object. If the user does not exist, display an appropriate message and exit the application.
    • If the user ID is valid, store the authentication code in a variable.
  2. Modify code for authorization functionality:
    • If the authorization code is “Admin,” allow the user to enter and display data.
    • If the authorization code is “User,” allow the user to display data only.
    • Modify the display of the data and totals to first display the user ID and authorization code.
  3. Submit the Python source code files and a Word document that contains a screenshot of input and display for user login information; a screenshot of data entry and the display of detail and totals when the authorization code is “Admin”; a screenshot of display of detail and totals only when the authorization code is “User." Include a 1–2 sentence reflection on the successes and challenges you had with this assignment.
  • Ensure all functionality is working correctly and code is written efficiently. For purposes of this assignment, writing code efficiently is defined as:
    • Using correct naming conventions for all variables and objects.
    • Using correct naming conventions for functions and methods.
    • Using built-in functions whenever possible.
    • Using the fewest lines of code needed to return multiple values from functions.
    • Using the fewest lines of code needed to complete the functionality defined

Step by Step Solution

There are 3 Steps involved in it

Step: 1

Based on the instructions here is a Python program that manages user information in a text file Heres a Python script that fulfills the requirements d... 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

Systems analysis and design

Authors: kenneth e. kendall, julie e. kendall

8th Edition

135094909, 013608916X, 9780135094907, 978-0136089162

More Books

Students also viewed these Programming questions

Question

Date decision to be made (if known)

Answered: 1 week ago

Question

What is UML?

Answered: 1 week ago

Question

List the advantages of mounting applications on the Web.

Answered: 1 week ago