Given four files named asiasales2009.txt, europesales2009.txt, africasales2009.txt, latinamericasales2009.txt, define four ofstream objects named asia, europe, africa, and latin, and use them, respectively, to open the four files for writing.

1 answer
Question:

Given four files named asiasales2009.txt, europesales2009.txt, africasales2009.txt, latinamericasales2009.txt, define four ofstream objects named asia, europe, africa, and latin, and use them, respectively, to open the four files for writing.

Answers

Answer:ofstream asia("asiasales2009.txt");  //It is used to open asiasales2009.txt files with the asia objects.ofstream europe("europesales2009.txt");  //It is used to open  europesales2009.txt files with the europe objects.ofstream africa("africasales2009.txt"); //It is used to open africasales2009.txt files with the africa objects.ofstream latin("latinamericasales2009.txt");//It is used to open latinamericasales2009.txt files with the latin objects.Explanation:The above code is written in the c++ language which is used to open the specified files with the specified objects by the help of ofstream class as described in the question-statements.The ofstream is used to open the file in the c++ programing language, so when a user wants to use the ofstream to open the file in written mode, then he needs to follow the below syntax--               ofstream object("file_name_with_extension");

Similar Solved Questions

2 answers

Plant-like protists (like algae) are considered plant-like because they are? A) autotrophic B) eukaryotic C) prokaryotic D) heterotrophic

Plant-like protists (like algae) are considered plant-like because they are? A) autotrophic B) eukaryotic C) prokaryotic D) heterotrophic...
1 answer

What is the relationship between events and patterns? O A. Patterns cause events to occur. O B. Patterns explain what causes events to happen. O C. Events that happen over and over form a pattern. O D. Events explain how patterns work. SUBNT

What is the relationship between events and patterns? O A. Patterns cause events to occur. O B. Patterns explain what causes events to happen. O C. Events that happen over and over form a pattern. O D. Events explain how patterns work. SUBNT...
1 answer

A student observes what happens when two different aqueous solutions are mixed in a test tube. Which of the following observations would be most indicative of a precipitation reaction? a. Gas bubbles are produced. b. A solid settles out. c. There is a color change. d. The test tube warms.

A student observes what happens when two different aqueous solutions are mixed in a test tube. Which of the following observations would be most indicative of a precipitation reaction? a. Gas bubbles are produced. b. A solid settles out. c. There is a color change. d. The test tube warms....
2 answers

Rewrite in simplest terms: -(3c - 8) - 3c​

Rewrite in simplest terms: -(3c - 8) - 3c​...
1 answer

April shoots an arrow upward at a speed of 80 feet per second from a platform 25 feet high. The pathway of the arrow can be represented by the equation h = -16t2 + 80t + 25, where h is the height and t is the time in seconds. What is the maximum height of the arrow? 90 feet 140 feet 125 feet 80 feet

April shoots an arrow upward at a speed of 80 feet per second from a platform 25 feet high. The pathway of the arrow can be represented by the equation h = -16t2 + 80t + 25, where h is the height and t is the time in seconds. What is the maximum height of the arrow? 90 feet 140 feet 125 feet 80 feet...
1 answer

In the book gathering blue what does kira attend in chapter 3

in the book gathering blue what does kira attend in chapter 3...
1 answer

I need help with 10 and 11 if possible please.

I need help with 10 and 11 if possible please....
1 answer

To copy the content of a letter in another letter we can dash featuresans) mobile​

to copy the content of a letter in another letter we can dash featuresans) mobile​...
1 answer

Why do electrons move from the negative end of the tube to the positive end

why do electrons move from the negative end of the tube to the positive end...
1 answer

Two glasses of milk and 4 snack bars have a total of 76 carbohydrates (carbs), and 4 glasses of milk and 3 snack bars have a total of 92 carbs.

Two glasses of milk and 4 snack bars have a total of 76 carbohydrates (carbs), and 4 glasses of milk and 3 snack bars have a total of 92 carbs....
2 answers

What information from the text is NOT supported by data on the chart?

What information from the text is NOT supported by data on the chart?...
1 answer

Barney has 1 16 5 yards of fabric. To make an elf costume, he needs 2 5 5 yards of fabric. How many costumes can Barney make?

Barney has 1 16 5 yards of fabric. To make an elf costume, he needs 2 5 5 yards of fabric. How many costumes can Barney make?...
1 answer

Why was trade so important to the empires of West Africa? Check all that are true. Trade provided money and wealth to the West African empires. - [ Trade caused continuous wars between the West African empires and the North African kingdoms. Trade caused the emperors to be cruel and rule the empires with strict laws and harsh punishments. () O Trade provided knowledge and culture to the West African empires.​

Why was trade so important to the empires of West Africa? Check all that are true. Trade provided money and wealth to the West African empires. - [ Trade caused continuous wars between the West African empires and the North African kingdoms. Trade caused the emperors to be cruel and rule the empires...
1 answer

Do you think it is right to use the electric chair on death row inmates. why or why not?

Do you think it is right to use the electric chair on death row inmates. why or why not?...
1 answer

Tổng số hạt của một nguyên tử là 58. Số hạt mang điện nhiều hơn số hạt không mang điện là 18 hạt. Xác định Z, N, E, A

Tổng số hạt của một nguyên tử là 58. Số hạt mang điện nhiều hơn số hạt không mang điện là 18 hạt. Xác định Z, N, E, A...
1 answer

Which cellular organelle is responsible for digestion and for the breakdown of damaged organelles inside an animal cell but not ina plant cell

Which cellular organelle is responsible for digestion and for the breakdown of damaged organelles inside an animal cell but not ina plant cell...
2 answers

Oraciones con la palabra segmento

Oraciones con la palabra segmento...

-- 0.011678--