In this laboratory, we are going to maintain a username-password system by storing the usernames and passwords in a file. The file 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

Answers

Answer 1

Answer:

Explanation:

ok i will do it for ya


Related Questions

X274: Recursion Programming Exercise: Cannonballs Spherical objects, such as cannonballs, can be stacked to form a pyramid with one cannonball at the top, sitting on top of a square composed of four cannonballs, sitting on top of a square composed of nine cannonballs, and so forth.

RequireD:
Write a recursive function that takes as its argument the height of a pyramid of cannonballs and returns the number of cannonballs it contains.

Answers

Answer:

The function in C is as follows:

#include <stdio.h>

int C_ball(int height){

if(height == 1) {

       return 1;}

   return (height * height) + C_ball(height - 1);}      

int main(){

   int n;

   printf("Height: ");

   scanf("%d",&n);

   printf("Balls: %d",C_ball(n));

   return 0;

}

Explanation:

The function begins here

#include <stdio.h>

This defines the function

int C_ball(int height){

If height is 1, return 1

if(height == 1) {

       return 1;}  

This calls the function recursively

   return (height * height) + C_ball(height - 1);}

The main begins here

int main(){

This declares the height as integer

   int n;

This prompts the user for the height

   printf("Height: ");

   scanf("%d",&n);

This calls the function

   printf("Balls: %d",C_ball(n));

   return 0;

}

What Are the Components of a Web Address? *​

Answers

Answer:

What Are the Components of a Web Address?

1.Protocol. The first component of a web address is the protocol, which is also known as the scheme. ...

2.Domain Name. The domain name part of the web address is the unique identifier for the website on the internet. ...

3.Domain Extension. ...

4.Path & Filename.

How does computer hardware and software work together?

Answers

Answer:

Computer software controls computer hardware which in order for a computer to effectively manipulate data and produce useful output I think.

Explanation:

For a company, intellectual property is _______________.


A) any idea that the company wants to keep secret


B) the same as the company’s policies


C) any topic discussed at a meeting of senior management


D) all of the company’s creative employees


E) a large part of the company’s value

Answers

Yea I think it is b but I’m not sure

For a company, intellectual property is any idea that the company wants to keep secret. Thus the correct option is A.

What is intellectual Property?

The type of integrity is defined as "intellectual property" which includes intangible works developed by humans with an innovative and problem-solving approach.

These intellectual properties are protected by companies to avoid leakage of the secret of development as well as to avoid imitation of the creation. This protection of the intellectual property is legally bounded.

If any violation of this act has been noticed and found guilty will have to face consequences in terms of charges of violation as well as heavy penalties based on the type and importance of the work.

Therefore, option A any idea that the company wants to keep secret is the appropriate answer.

Learn more about intellectual property, here:

https://brainly.com/question/18650136

#SPJ2

How should you schedule a meeting with someone in another time zone?

Answers

If you know what timezone they're in, try to work out what time in your own timezone your free, then tell the other person to do the same. Tell them what times in your timezone and the other can search up what the time is in their own timezone. If there is a specific time when you are both free, use that.

Ex:

You live in the U.S. but you have a meeting with someone in the U.K. You're only free at 4:00pm-6:00pm and they're only free from 10:00am-11:00am. 11:00am in England is 4:00pm in the U.S. so do at that time!

Hope this helps!

Assume a future where security counter measures against DoS attacks are much more widely implemented than at present. In this future network, anti-spoofing and directed broadcast filters are widely deployed. Also, the security of PCs and workstations is much greater, making the creation of botnets difficult. Do the administrators of server systems still have to be concerned about, and take further countermeasures against, DoS attacks? If so, what types of attacks can still occur, and what measures can be taken to reduce their impact? Explain in detail with valid diagram and example.

Answers

Answer:

yes administrators have to be concerned

Explanation:

It is necessary for countermeasures to be taken against DoS attacks

The types of attacks that can still occur are:

If the network connection get to be overloaded,  there could be flash crown of this computer system and fraudulent activities maybe initiated. By flash crowd  we mean that the there is a great deal of traffic on the system and this could cause the network connection to be destroyed.

To reduce the impact of this kind of attacks,

1. there should be enough or excess network bandwidth  and distributed servers should be replicated if there is a possibility that network could get to be overloaded.

2. restriction is more commonly done on sporting sites. Restriction brings about an increase in implementation cost.

3. The impact of this type of attack can be reduced by stopping unwanted traffic throught the implementation of filters

4. Use strong antivirus on computer sytems that are used to connect to the internet

It is desired to create a mortgage estimator by writing a program containing a function. The user inputs the amount of loan (L), the loan term in number of months (W, and the annual interest rate (D in the script. The script then makes use of a function that accepts these values as inputs through its argument and calculates and returns the monthly payment and the total payments over the life of the loan. The monthly payment and the total payment could be calculated using the following expressions:
monthly payment 1-(1+ 1 112) N I/12 total payment Nxmonthly payment
Note that the interest rate must be expressed in decimal; for example, if the interest rate is 8% it must be entered as 0.08 Test your program for several scenarios and submit the results with the program listing.
The values of L, I, monthly payment, and total payment should be written to a file as shown below:
Interest Loan Amount Interest Months Monthly Payment Total Payment
0.06 10000 36
108 120000 0.05
0.07 85000 48
0.08 257000 240
0.05 320000 120

Answers

Answer:

In Python:

L = int(input("Loan Amount: "))

N = int(input("Months: "))

I = float(input("Annual Interest Rate: "))

monthly_payment = round(L/((1 - (1 + I/12)**(-N))/(I/12)),2)

total_payment = round(N * monthly_payment,2)

 

f= open("outputfile.txt","a+")

f.write(str(L)+"\t\t"+str(I)+"\t\t"+str(N)+"\t\t"+str(monthly_payment)+"\t\t"+str(total_payment)+"\n")

Explanation:

The next three lines get the required inputs

L = int(input("Loan Amount: "))

N = int(input("Months: "))

I = float(input("Annual Interest Rate: "))

Calculate the monthly payment

monthly_payment = round(L/((1 - (1 + I/12)**(-N))/(I/12)),2)

Calculate the total payment

total_payment = round(N * monthly_payment,2)

Open the output file

f= open("outputfile.txt","a+")

Write output to file

f.write(str(L)+"\t\t"+str(I)+"\t\t"+str(N)+"\t\t"+str(monthly_payment)+"\t\t"+str(total_payment)+"\n")

It must ask the user to input the tuition for this year. Suppose the tuition for a university is 10000$ this year and increases 5% every year. In one year, the tuition will be 10500$. Write a Java program that displays the tuition in 10 years, and the total cost of four years’ worth of tuition after the tenth years

Answers

Answer:

Answered below

Explanation:

//Program in Java

int percentIncrease = 0.05;

Scanner scan = new Scanner(System.in);

System.out.print("Enter tuition: ");

int tuition = scan.nextInt();

double tenYearIncrease = (percentIncrease * 10) * tuition;

double tenYearsTotal = tuition + tenYearIncrease;

//Tuition in ten years

System.out.print(tenYearsTotal);

//Total four years after

double newTuition = tenYearsTotal;

double fourYearsIncrease = (percentIncrease * 4) * newTuition;

double fourYearsTotal = newTuition + fourYearsIncrease;

System.out.print(fourYearsTotal);

Why would an organization need to be aware of the responsibilities of hosting

personal data in its platforms?

Answers

Answer:

Providing transparent services for platform customers. Following data protection regulations to avoid disruptions from lack of compliance.

1.An algorithm used to find a value in an array is called a ______________.
2.A search algorithm returns the element that we’re searching for, rather than the index of the element we’re searching for.
A.True
B.False
3.Suppose we used our searching algorithm to look for a specific element in a list. The algorithm returned -1. What does this mean?

A.Our algorithm found the element we were looking for which is -1.
B.Our algorithm did not find the element we were looking for.
C.Our algorithm found the element, but could not determine the index.
D.Our algorithm found the element at index -1.

Answers

Answer:

1.search 2.False 3.Our algorithm did not find the element we were looking for.

Explanation:

An algorithm used to find a value in an array is called a:

Search

A search algorithm returns the element that we’re searching for, rather than the index of the element we’re searching for is:

False

If we used our searching algorithm to look for a specific element in a list and the algorithm returned -1. The thing which this means is:

Our algorithm did not find the element we were looking for.

What is Algorithm?

This refers to the use of well defined instructions to execute a particular problem in sequential order.

With this in mind, we can see that algorithm is used to search for particular items and when the item is not found, then there would be a return of -1 because the element was not included in the array.

Read more about algorithms here:
https://brainly.com/question/24953880

The information technology (IT) department of a real-estate group cosponsored a data warehouse with a County governement. In the formal proposal written by the IT team, costs were estimated at 8,000,000/- the project’s duration was estimated to be eight months, and the responsibility for funding was defined as the business unit’s. The IT department proceeded with the project before it even knew if the project had been accepted. The project actually lasted two years because requirements gathering took nine months instead of one and a half, the planned user base grew from 200 to 2,500, and the approval process to buy technology for the project took a year. Three weeks before technical delivery, the IT director canceled the project. This failed endeavor cost the organization and taxpayers 25,000,000/-.

Why did this system fail?

Why would a company spend money and time on a project and then cancel it?

What could have been done to prevent this?​

Answers

The system fail because the company had to pay and spend more money in order to pay the workers.

How should employees behave during interactions with clients and co-works

Answers

Answer:always be nice and welcoming

Explanation:

with the utmost respect, you are supposed to respect and listen to your superiors, they are paying you and giving you a job after all, they can easily take it.

User ideas for ro blox?

Answers

Answer:

You can put random people, or something you like to do, like Soccer2347 (that was just an example) or your favorite animal, Horse990. But Rob lox has to approve it first

Explanation:

Answer:

You can do a lot of usernames despite the fact that a lot of them have also been taken already. You can do something like your favorite food, sport, etc, and combine it into a couple words, and then add numbers to the end if the name has been taken already.

There is a nickname feature too which let's you name yourself whatever you want.

PYTHON
Write a program that picks up a secret number from 1 to 100 when the user starts the game and asks the
user to guess what number it is. If the user’s guess is correct, the program congratulates the user for the
perfect answer and then make it possible for the user to start a new game; otherwise, it will tell the user
that it is too high or too low and let the user continue to play.
In your program, you may use the following code to generate a random number from 1 to 100 as the
secret number for a new game.
import random
number = random.randint(1, 100)
In addition, your program will keep track of the number of guesses the user made and display the number
of guesses when a game is over. If a user is successful by more than 7 tries, display an additional message
to tell the user to consider a different strategy in order to improve one’s performance.
Given below is a typical dialog between a user and your program when the user uses your program.
Hello, what is your name? John
John, I am thinking a number between 1 and 100 (both included).
Can you guess what it is?
Guess a number (1-100): 50
Your guess is too high. Try again.
Guess a number (1-100): 25
Your guess is too low. Try again.
Guess a number (1-100): 35
Your guess is too low. Try again.
Guess a number (1-100): 43
John, you won in 4 tries. Congratulations!
Do you want to continue to play? no
Thank you for playing this game. Bye.
In the above, the user plays the game only once. If the user says ‘yes’ at the second to last step, he/she
would be able to play the game again.

Answers

Answer:

import random

print("Hello! I have a random number from 1 to 100! It is your job to try and guess it!")

number = random.randint(1,101)

guess = int(input("start to guess: "))

num_guesses = 1

while guess != number:

   if guess > number:

       print("lower")

       guess = int(input("try again: "))

       num_guesses +=1

   elif guess < number:

       print ("higher")

       guess = int(input("start to guess: "))

       num_guesses +=1

print("congrats it took you", num_guesses, "tries")

Explanation:

The director of security at an organization has begun reviewing vulnerability scanner results and notices a wide range of vulnerabilities scattered across the company. Most systems appear to have OS patches applied on a consistent basis_ but there is a large variety of best practices that do not appear to be in place. Which of the following would be BEST to ensure all systems are adhering to common security standards?
A. Configuration compliance
B. Patch management
C. Exploitation framework
D. Network vulnerability database

Answers

Answer:

D. Network vulnerability database

Explanation:

A database management system (DBMS) can be defined as a collection of software applications that typically enables computer users to create, store, modify, retrieve and manage data or informations in a database. Generally, it allows computer users to efficiently retrieve and manage their data with an appropriate level of security.

In this scenario, The director of security at an organization has begun reviewing vulnerability scanner results and notices a wide range of vulnerabilities scattered across the company. Most systems appear to have OS patches applied on a consistent basis but there is a large variety of best practices that do not appear to be in place. Thus, to ensure all systems are adhering to common security standards a Network vulnerability database, which typically comprises of security-related software errors, names of software, misconfigurations, impact metrics, and security checklist references should be used.

Basically, the Network vulnerability database collects, maintain and share information about various security-related vulnerabilities on computer systems and software programs.

Analyzing Types of Graphics
In which situation would a floating image be more useful than an in-line image?
O You want the image to stay within a specific paragraph of text.
O You want the image to come from a gallery of photos in your camera.
You want the image to be on the final page no matter what happens to the text.
O You want a screen-capture image of a software program on your computer.

Answers

Answer:you want the image to be on the final page no matter what happens to the text.

The situation that a floating image be more useful than an in-line image when you want the image to be on the final page no matter what happens to the text.

What helps in float image?

The use of Cascading Style Sheets is known to be a float property that often functions to help place images on a web page.

Conclusively, given the situation above, that a floating image be more better than an in-line image only if you want the image to be on the final page no matter what occurs in the text.

Learn more about Graphics from

https://brainly.com/question/25817628

In a word processing program, under which tab or menu option can you adjust the picture brightness?

Answers

Explanation:

You must have selected a picture in order the tab format to be available. you should click the picture then you want to change the brightness for and u under picture tools, on the format tab,in the adjust group, click corrections.

For this exercise, you are going to complete the printScope() method in the Scope class. Then you will create a Scope object in the ScopeTester and call the printScope.
The method will print the name of each variable in the Scope class, as well as its corresponding value. There are 5 total variables in the Scope class, some of which can be accessed directly as instance variable, others of which need to be accessed via their getter methods.
For any variable that can be accessed directly, use the variable name. Otherwise, use the getter method.
Sample Output:
The output of the printScope method should look like this:
a = 5
b = 10
c = 15
d = 20
e = 25
public class ScopeTester
{
public static void main(String[] args)
{
// Start here!
}
}
public class Scope
{
private int a;
private int b;
private int c;
public Scope(){
a = 5;
b = 10;
c = 15;
}
public void printScope(){
//Start here
}
public int getA() {
return a;
}
public int getB() {
return b;
}
public int getC() {
return c;
}
public int getD(){
int d = a + c;
return d;
}
public int getE() {
int e = b + c;
return e;
}
}

Answers

Answer:

Explanation:

The following is the entire running Java code for the requested program with the requested changes. This code runs perfectly without errors and outputs the exact Sample Output that is in the question...

public class ScopeTester

{

public static void main(String[] args)

{

       Scope scope = new Scope();

       scope.printScope();

}

}

public class Scope

{

private int a;

private int b;

private int c;

public Scope(){

a = 5;

b = 10;

c = 15;

}

public void printScope(){

       System.out.println("a = " + a);

       System.out.println("b = " + b);

       System.out.println("c = " + c);

       System.out.println("d = " + getD());

       System.out.println("e = " + getE());

}

public int getA() {

return a;

}

public int getB() {

return b;

}

public int getC() {

return c;

}

public int getD(){

int d = a + c;

return d;

}

public int getE() {

int e = b + c;

return e;

}

}

For current events, what type of sources would we use to learn about them?

A”Scholarly journals

B”News sources (broadcast, web, print)

C”Books

D”Reference works (encyclopedias, almanacs, etc.)

Answers

Answer:

B. News Sources (broadcast, web, print)

Explanation:

To learn about current events the most ideal sources of reference are News sources, either broadcast, web or print.

For example, if you're seeking breaking news or stories that are developing in the business world, the following sources are News sources you can turn to as sources of reference: CNN Business, Forbes, Bloomberg's Business Week, Fortune and other relevant Business News Media outfits.

what are the groups located within developer tab? check all that apply.

Controls
References
Code
Protect
Add-Ins
Macros​

Answers

Answer:

controls, code, protect, and add-ins!

Explanation:

edge 2021

Creative Commons material often costs money to use.

True
False

Answers

Answer:

true

Explanation:

To Install Windows 7, we need at least :
a)16 MG of free hard disk space
b) 46MG of free Hard Disk Space ​

Answers

Answer:

B

Explanation:

Your OS (operating System) Needs as much storage as possible for updates and programs, cache, tempFiles, etc. While microsoft recommends more than 1 Gb, the best answer would be answer B.

Read more here: https://support.microsoft.com/en-us/windows/windows-7-system-requirements-df0900f2-3513-a851-13e7-0d50bc24e15f#:~:text=1%20gigabyte%20(GB)%20RAM%20(,20%20GB%20(64%2Dbit)

whats difference between DCE AND DTE serial interface

Answers

DCE stands for data circuit-terminating, data communications, or data carrier equipment - this is a modem or more generally, a line adapter.

DTE stands for data terminal equipment which generally is a terminal or a computer.

Basically, these two are the different ends of a serial line.

Which lighting technique can often heighten a dramatic story?

No lighting.
Front lighting.
Natural lighting.
Side or back lighting.

Answers

Answer:

side or back lighting

Explanation:

big brain

Very large storage system that protects data by constantly making backup copies of files moving across an organization's network is known as ...

Answers

Answer:

RAID is a data storage virtualization technology that combines multiple physical disk drive components into one or more logical units for the purposes of data redundancy, performance improvement, or both.

Explanation:

RAID is a data storage virtualization technology that combines multiple physical disk drive components into one or more logical units for the purposes of data redundancy, performance improvement, or both.

What is File system failure?

File system failure refers to disk-related errors that may be due to corrupt files,  disk integrity corruption, file execution policies, bad sectors, etc. These errors may prevent be causing users from accessing or opening files. The first line of defense against a file system failure is a well-defined set of proper system backup and file maintenance procedures.

These errors can be encountered in files such as images, documents, PDFs, movies, etc. In order to protect and provide defense against file system failure, it is important to manage proper backup and file maintenance procedures.

Therefore, RAID is a data storage virtualization technology that combines multiple physical disk drive components into one or more logical units for the purposes of data redundancy, performance improvement, or both.

You can learn more about file system at:

brainly.com/question/14312784

#SPJ2

What are the uses of computer in educational setting?

Answers

Answer:

Quick Communication & Correspondence

Explanation:

Another main advantage of using computers in the education field is the improvement in the quality of teaching-learning process and communication between students & teachers. For this, they use Microsoft PowerPoint to prepare electronic presentations about their lectures.

Answer:

there are different uses of computer in education setting fact from its application include

E learninginstructional materialE examease of communicationstorage

Which of the following is not a type of degree of freedom?
A. Twisting
B. Linear movement
C. Rotation
D. Bending

Answers

Answer:

Option (B) Linear movement will be the answer.

please help me faster plzzz
correct plzz​

Answers

Answer:

a. A numeric keypad.

b. An interpreter.

c. A 3D printer.

d. A speaker.

Explanation:

An output device can be defined as a hardware device that typically receives processed data from the central processing unit (CPU) and converts these data into information that can be used by the end user of a computer system.

Also, an input device can be defined as any device that is typically used for sending data to a computer system.

Generally, all of the output and input device of a computer are known as peripheral (external) devices and they provide data (informations) to the end users in various formats such as video, audio, texts, images etc.

Since output and input devices are peripheral (external) devices, they can be connected to the computer system wirelessly or through a wired-connection (cable).

Some examples of peripheral (external) devices are monitor, speakers, keyboard, printer, mouse, scanner, projector etc.

Basically, the three (3) key element of a computer system are: a set of memory modules, processor and a set of input-output (I/O) modules. Each of the input-output (I/O) module interfaces to the central switch or system bus and are used to control one or more peripheral (external) devices.

a. A numeric keypad is a device used to input a PIN. It comprises of numbers ranging from 0 to 9.

b. An interpreter analyses and executes a program line by line.

c. A 3D printer produces output in the form of solid objects. It is typically used for inscribing or printing textual informations or graphic images on an object in three dimensions.

d. A speaker produces output in the form of sound. It is an electronic device that converts electrical signals into sound energy (waves).

2. How has the internet changed the way that people get news?

Answers

Answer:

Explanation:

you can access news from anywhere and know what is going on

Answer:

Most of the news is fact due to the ablilty of anybody can make it

Explanation:

is a
square-shaped blade perfect for digging holes for plants and
bushes.​

Answers

Answer:

Yes. Designed to use in tight spaces, the square-shaped blade is perfect for digging holes for plants and bushes, especially in established gardens where you don't want to disturb existing plants.

Explanation:

Other Questions
Someone help me with this A table of values of a linear function is shown below.Find the slope and y-intercept of the function's graph, and find the equation for the function. If two circles are externally tangent, it is not possible to draw an external tangent line. True/False Explain womens contributions to the war effort, and describe the challenges they faced. Use evidence from the videos to support your conclusions Please please help please please ASAP please I'm begging you please I have 10 minutes please y'all help please any ACE that can help please How did World War II's actors, goals, and strategies compare with World War I? please help! I need the answer PLEASE HELPP thanks (if you do):)) A map titled Early Muslim Expansion showing Europe, Asia, Persia, the Arabian Peninsula, and Africa. Territory in 632 C E includes the western half and eastern coast of the Arabian Peninsula. Territory in 661 C E includes the rest of the Arabian Peninsula, most of Persia, and a small portion of the northern coast of Africa. Territory in 750 C E includes more of the northern coast of Africa, most of Spain, and extends from Persia in to Asia.Study the map, then use the drop-down menus to complete the sentences.Lands conquered by 632 CE was under the leadership of .Islam first spread across the Arabian Peninsula under .The Islamic caliphate reached its largest size in 750 CE, during the leadership of . HELP PLEASE !!Part D: Three students were absent the day Mario recorded the heights. The heights of these three students are 45 inches, 60 inches, and 70 inches. Consider how the box-and-whisker plot will change if you add these three measurements to the data. Which of the following statements is FALSE? 64, 53, 6060, 56, 5851, 55, 60A. The whiskers will be longer as the minimum will decrease and the maximum will increase. B. The first quartile will decrease so the box will be longer. C. The first and third quartile will be the same so the length of the box will not change. D. The median will shift to the right. Can you guys pleas help me Find the answer to 52332 . Which statement is true about the coordinates of points M and N? what might working people be willing to join the knights? why might factor owners and other business leaders resist the knights? What is the GCF of 8a^2 and 11? 32 g of a metal, M, reacts with 8 g of oxygen to form an oxide. The formula of the oxide is MO. What is the atomic mass of M in g mol-? 2KClO 2KCl + 3O If 25.0 g of KClO decompose, what mass of O will form?* which structure stores energy for the in the form of ATP?A) lysomeB) mitochondrionC)endoplasmic reticulum D)golgi apparatus 11Select the correct answer.The First Continental Congress that met in 1774 created the Continental Association. What was this Association?O A.a group of men who organized demonstrations against the Intolerable Acts in every colony B.an agreement to boycott all British imports and CO stop exporting to Britain and its colonies C.an alliance that used the Committees of Correspondence to organize inter-colonial protests and rebellion D.a group of men who went on to form and command the Continental Army in preparation of the RevoluticO E.an agreement to support the Suffolk Resolves that declared that the colonists weren't liable to obey the In lo What are the odds that the spinner lands on red or the number 4?44233 In 2019, Ivanhoe Company had a break-even point of $385,000 based on a selling price of $7 per unit and fixed costs of $115,500. In 2020, the selling price and the variable costs per unit did not change, but the break-even point increased to $454,000. Required:a. Compute the variable costs per unit and the contribution margin ratio for 2019.b. Compute the increase in fixed costs for 2020.