Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write the full code for Create and call a function to: Open a text file for storing the user information. The file must beopened so

Write the full code for "Create and call a function to: Open a text file for storing the user information. The file must beopened 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 theuser ID into a list object for validation purposes.2. Create and call a function to use a loop that will obtain user input untilterminated by the user typing End. Allow the user to input a user ID, password, and authorizationcode. Validate that the user ID does not already exist in the list objectand that only Admin or User is entered as an authorization code. Write the user ID, password, and validation code as a pipe-delimitedlist to the text file and add the user ID to the list object if allvalidations have passed.3. After the user terminates the data entry loop, create and call a new functionthat 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. Forpurposes 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 fromfunctions. Using the fewest lines of code needed to complete the functionalitydefined.Part 2 Updating the Existing Application1. Define a class named Login. The class should have three properties: User ID Password Authorization2. 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, andauthorization code in a list object. Note: Multiple list objects may beneeded for this functionality. Enter a user ID. Enter a password. Validate the user ID by reading the list object. If the user does notexist, display an appropriate message and exit the application. If the user ID is valid, verify that the password matches. If thepassword does not match, display an appropriate message and exitthe application. If the user ID is valid and password matches:1. Create an object from the class Login.2. Store the user ID, password, and authentication code in theproperties.3. Modify code for authorization functionality: If the authorization code stored in the object is Admin, allow theuser to enter and display data. If the authorization code stored in the object is User, allow the userto display data only. Modify the display of the data and totals to first display the user ID,password and authorization code using the properties in the object."

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

What Is A Database And How Do I Use It

Authors: Matt Anniss

1st Edition

1622750799, 978-1622750795

More Books

Students also viewed these Databases questions