Answered step by step
Verified Expert Solution
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 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 pipedelimitedlist to the text file and add the user ID to the list object if allvalidations have passed 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 builtin 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 Updating the Existing Application Define a class named Login. The class should have three properties: User ID Password Authorization 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: Create an object from the class Login Store the user ID password, and authentication code in theproperties 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 IDpassword and authorization code using the properties in the object."
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