Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Will anyone be willing to help write this code? I'm very new at this and it just needs to be written for a beginner Create

Will anyone be willing to help write this code? I'm very new at this and it just needs to be written for a beginner

Create a program to verify a user name and password given by a user

Create a text file named "correctData.txt". 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.

The image is how it supposed to look. Thank you so much!image text in transcribed

image text in transcribed

eWindows system32 cmd.exe Login Username MyNameJeff Invalid username or password. You have 2 renaining. Login Username Hulk assword:Smash nvalid username or password. You have 1 renaining. Login Username: DarthUader Attempts exceeded. Press any key to continue

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

Modern Database Management

Authors: Donald A. Carpenter Fred R. McFadden

1st Edition

8178088045, 978-8178088044

More Books

Students also viewed these Databases questions