Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can someone tell me how to do this please? 1. First, the program should read a single, full line from the file input.txt. This will

Can someone tell me how to do this please?

1. First, the program should read a single, full line from the file input.txt. This will be used as the user's correct password. Do not include the newline in the password. 2. The program should then prompt the user on standard input for a password, with the following text not including quotes and not followed by a newline: "Enter password: " 3. If the user types in the right password, the program go to step 5. Otherwise, the use is prompted with "Wrong! Try again: ", again not folowed by a newline, and the user types in another guess. 4. Step 3 is repeated until the user types in the right password. At that point, go to step 5. 5. The program opens the file output.txt for writing (in APPEND MODE, NOT TRUNCATE MODE) and writes "Access granted. There were failed attempts.", followed by a newline, where is the number of times the user got the password wrong before getting it right. Name of program should be: FilePassword

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

Professional Microsoft SQL Server 2014 Integration Services

Authors: Brian Knight, Devin Knight

1st Edition

1118850904, 9781118850909

More Books