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
erik [133]
3 years ago
11

Write the definition of a function named fscopy. This function can be safely passed two fstream objects, one opened for reading,

the other for writing. Assume that the input source is a text file consisting of a sequence of newline character-terminated lines. The function simply copies, line by line, the entire content of the data source associated with the first argument to the data target associated with the second argument. No value is returned.
Computers and Technology
1 answer:
diamong [38]3 years ago
6 0

Question:

Write the definition of a function named fscopy that does a line-by-line copy from one stream to another. This function can be safely passed two fstream objects, one opened for reading, the other for writing. In addition, it gets a bool argument that is true if the output lines are to be numbered, and another argument, an int that specifies line-spacing in the output.

Assume that the input source is a text file consisting of a sequence of newline character-terminated lines. The function copies, line by line, the entire content of the data source associated with the first argument to the data target associated with the second argument. It returns the number of lines read in. If it the third parameter, the bool is true, every line that is output is preceded by a 6-position field holding the line number (an integer) followed by a space and then the actual line. If the last argument, the int is 2 or more, it specifies the line spacing: for example, it is 3, there are two blank lines output after each line printed. These blank lines are NOT numbered.

Answer:

void fscopy(fstream &fsin, fstream &fsout)

{

string s;

getline(fsin, s, '\n');

while (!fsin.fail( ) )

{

fsout << s << endl;

getline(fsin, s, '\n');

}

}

You might be interested in
Search engines enable you to
Phoenix [80]

Located web pages related to a specific subject


Please let me know if you have questions !

4 0
3 years ago
Categorize the following relationships into generalization, aggregation, or association. Beware, there may be n-ary associations
Oksana_A [137]

Answer:

Answer explained below

Explanation:

a. A country has a capital city.------------ aggregation(city is part of country)

b. A dining philosopher uses a fork. ----------- association(philosopher and fork are different entities)

c. A file is an ordinary file or a directory file. ------- generalization( both ordinary and directory files are having attributes of files)

d. Files contain records.--------- aggregation( records are part of File)

e. A polygon is composed of an ordered set of points. ----------- aggregation( points are parts of polygon)

f. A drawing object is text, a geometrical object, or a group. --------- generalization( text and geometrical objects are drawing object)

g. A person uses a computer language on a project. -------- aggregation( person and computer language are part of project)

h. Modems and keyboards are input/output devices. -------- aggregation( Modems and keyboards both are I/O devices)

i. Classes may have several attributes.------- aggregation( attributes are part of classes)

j. A person plays for a team in a certain year. ----------- aggregation(player is part of team)

k. A route connects two cities. --------- aggregation( route consists of two cities)

l. A student takes a course from a professor. ----------- association( student and course are separate entities)

5 0
3 years ago
You would set a ___________ to prevent users from immediately changing their password several times in one day to return to the
Temka [501]

Answer:

The answer is (B) Maximum password age.

Explanation:

To prevent several changing of passwords by a user in a day, the maximum times a password can be rest within a day is normally set by  the system administrator.

The setting ensures the password is returned to the current settings of the password on the system for the user and prevents unnecessary changing of passwords in a day by user.

6 0
3 years ago
Read 2 more answers
What changes could you make so that a message, "User input deemed invalid." during designing a simple calculator program for you
Afina-wow [57]

The most appropriate change in this situation would be to change the message "User input deemed invalid" to "You made a mistake, try again, you can".

<h3>What should we change to improve the children's experience?</h3>

To improve children's experience with this new calculator program, we must adapt all the features of the program for children's users. Therefore, the buttons, the messages and everything related to this program must be suitable for their motor and brain development.

Therefore, it is considered that the message "User input deemed invalid" is not suitable for children because they may not understand this message or misinterpret it and desist from using the new program.

So, the most appropriate message to replace the previous message would be:

  • "You made a mistake, try again, you can"

Because this message is suitable for the friendly language that children use in their daily lives and they would better understand the message without giving up using the new program or the calculator.

Learn more about programs in: brainly.com/question/13264074

#SPJ1

3 0
2 years ago
Hi I paid for brainy plus, but it says the it can't renew and try paying for it again but it won't work. Please help
Scorpion4ik [409]

Answer:

Contact CS, ( customer support ) They should be able to help you. Go to this link for more info. brainly.com/contact/index

Explanation:

8 0
3 years ago
Other questions:
  • Objective:This assignment is designed to give you experience with thinking about algorithm analysis and performanceevaluation.Pr
    11·1 answer
  • Consider the following code segment.
    15·1 answer
  • write a program that calculates the total grade for N classroom exerices as a perfentage. the user should input the value for N
    11·1 answer
  • Thomas has signed a deal with a production house that allows them to use his images on their website. What is required when imag
    5·2 answers
  • Assume there are two variables, k and m, each already associated with a positive integer value and further assume that k's value
    13·1 answer
  • 3. Write a program to find the area of a triangle using functions. a. Write a function getData() for user to input the length an
    10·1 answer
  • Bob The Penguin is a real you-tuber, and he plays Mine-craft. Who is his owner?
    6·1 answer
  • state an application that would be better to write c++ than java and give a rationale for your answer
    5·1 answer
  • The original programs awaiting tanslation is called​
    11·1 answer
  • Mention and discuss specific professional ethics related to augmented reality, artificial intelligence, and the internet of thin
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!