Question: Part 1 - Creating the New Application 1 . Create and call a function to: * Open a text file for storing the user information.
Part Creating the New Application
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.
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.
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.
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, and authorization code in a list object. Note: multipe list objects may be needed for this funtionality
Enter a user ID
Enter 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 is vaild, verify that the password matches. If the password does not match, display and appropriate message and exit the application.
If the user ID is valid and passworf matches
Create an object from the class login
Store the user ID password, and authentication code in the properties
Part Modify code for authorization functionality
if the authorization code stored in the object is "Admin", allow the user to enter and display data.
If the authorization code stored in the object is "User", allow the user to 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
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
