1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Kipish [7]
3 years ago
7

In this laboratory, we are going to maintain a username-password system by storing the usernames and passwords in a file. The fi

le will consist of a single username and password per line with a space in between.
1. Begin by creating a class PasswordFile which has the following interface:
class PasswordFile
public:
PasswordFile(string filename); // opens the file and reads the names/passwords in the vectors user and password.
void addpw(string newuser, string newpassword); //this adds a new user/password to the vectors and writes the vectors to the file filename bool checkpw(string user, string passwd); // returns true if user exists and password matches
private:
string filename; // the file that contains password information
vector user; // the list of usernames
vector password; // the list of passwords
void synch(); writes the user/password vectors to the password file
The constructor accepts a filename, and reads the file one-line at a time and adds values to the vectors user and password. The function addpw adds a user/password pair to end of each vector.
2. Now create a password.txt file with some entries such as:
jsmith turtle
madams apple
Also create a main program to test your classes :
int main() PasswordFile passfile
("password.txt");
passfile.addpw("dbotting","123qwe");
passfile.addpw("egomez", "qwerty");
passfile.addpw("tongyu", "liberty");
// write some lines to see if passwords match users
Computers and Technology
1 answer:
Dominik [7]3 years ago
5 0

Answer:

Explanation:

ok i will do it for ya

You might be interested in
Programmers use an Integrated Development Environment (IDE) to write software programs, because:
Natali [406]

Answer:

A) It simplifies the process by providing a single user interface for multiple software tools.

Explanation:

6 0
3 years ago
Lukas entered the date 9-17-2013 in an Excel workbook. He wants the date to appears as “Tuesday, September 17, 2013.” Instead of
Sphinxa [80]
<span>The answer is highlight cells, select the Insert tab, click on the number, select Date from the category box, highlight the correct format, and click OK.</span>
8 0
4 years ago
22. A user receives an error message when logging into Salesforce. What is the first check performed by an administrator?
WARRIOR [948]

Answer:

The first check performed by an administrator that it  View the login history.

Explanation:

When user logging into Salesforce it receives an error message into the  screen it view the logging detail which help us take to troubleshoot the problem. The logging history keeps track information like  who is access the system last time ,date etc .login history  also display up to 20,000 records of user logins for the last six months.

4 0
3 years ago
What is the purpose of a web server? What is the purpose of a web browser?
Sauron [17]

Answer: the purpose of a web browser is to help answer and needed questions, and to get to sites.

Explanation:

4 0
2 years ago
Which best describes a VPN?
aleksandr82 [10.1K]

A private connection through a private network

8 0
3 years ago
Read 2 more answers
Other questions:
  • What is an example of constructive criticism for an employee who is shy during meetings?
    15·2 answers
  • When using a wireless mouse, what is the most common port used for the transmitter? 
    7·1 answer
  • Jeffrey works with a huge database of spreadsheet records each day. To organize and identify these spreadsheets, he wants to ass
    7·2 answers
  • An option button is a square button that enables you to make one choice among two or more options.
    15·1 answer
  • Heidi uses her computer to write articles for a newspaper. She uses a program to listen to the articles before she submits them
    5·1 answer
  • Many of the first photographers were actullay scientists and inventors
    11·1 answer
  • Qr code is more developed than barcode​
    11·1 answer
  • Which item is essential to know before sketching a navigation menu flowchart?
    7·2 answers
  • What is the viewport?
    5·1 answer
  • Which are ways that technology keeps you hooked?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!