Question
This assignment was locked Oct 31 at 11:59pm. Create a program to verify a user name and password given by a user Create a text
This assignment was locked Oct 31 at 11:59pm.
Create a program to verify a user name and password given by a user
Create a text file named "correctData.txt" (You will NOT upload this file during submission). Place a username on line 1 in the txt file and a password on line 2 in the file. This will be used for testing.
Create the following functions and call them starting from main:
void Login () - This function is responsible for displaying the prompts asking for user name and password. It will only allow a user to attempt a password 3 times for security measures before returning back to main. You will need to use a loop to accomplish this task.
bool CheckCredentials (string username, string password)- In order to validate the username and password. This is a boolean return and will return true or false from this function if the data verified does not match the file.
You will need to use fstream to create an instance of a file using ifstream. Compare the strings to the data in the text file. Remember, the username will be on line 1 in the text file and the password will be on line 2.
Remember:
Close the fstream file before returning 0
Prototype functions.
Don't use global variables
When completed, upload the .cpp file only! Don't worry about uploading the .txt file. Please use discussion board if you have any clarity questions about the assignment.
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