Manually create and store these files (on the online compiler) and write a C++ program that opens each file and: 1. Count the number of values 2. Create a dynamic array with size equal to the number of values in step1 3. Read the file content again and store it in the dynamically allocated array The program will then sum up the array sizes in all files and dynamically create a big array with a size equal to the summation of the three sizes. The program will then concatenate the three arrays into the big array (which is dynamically allocated with the correct size, again the size here is equal to the summation of the three sizes). And print out all the arrays (define a print function to do that and call it from main()) Close all files and deallocate the arrays. Example output: Arr1 content: 1234 33 22 567 4 -9 -34 Arr2 content: 10 122 -3 40 331 22 567 4 -9 -34 99 100 203 -9 0 Arr3 content: -134 299 130 603 -19 10 ArrBig content: 1234 33 22 567 4 -9 -34 10 122 -3 40 331 22 567 4 -9-34 99 100 203-90-134 299 130 603 -19 10 Press any key to continue ... Note: your program must work correctly regardless of the number of values in each file. You cannot assume that the number of values in each file is fixed. If your program works only for the above exa considered. You can use the following skeleton code: #include #include using namespace std; /to do: declare and define your print function Ent main() Save Al Answers " L Saue AJL Answers to save all answers.
Manually create and store these files (on the online compiler) and write a C++ program that opens each file and: 1. Count the number of values 2. Create a dynamic array with size equal to the number of values in step1 3. Read the file content again and store it in the dynamically allocated array The program will then sum up the array sizes in all files and dynamically create a big array with a size equal to the summation of the three sizes. The program will then concatenate the three arrays into the big array (which is dynamically allocated with the correct size, again the size here is equal to the summation of the three sizes). And print out all the arrays (define a print function to do that and call it from main()) Close all files and deallocate the arrays. Example output: Arr1 content: 1234 33 22 567 4 -9 -34 Arr2 content: 10 122 -3 40 331 22 567 4 -9 -34 99 100 203 -9 0 Arr3 content: -134 299 130 603 -19 10 ArrBig content: 1234 33 22 567 4 -9 -34 10 122 -3 40 331 22 567 4 -9-34 99 100 203-90-134 299 130 603 -19 10 Press any key to continue ... Note: your program must work correctly regardless of the number of values in each file. You cannot assume that the number of values in each file is fixed. If your program works only for the above exa considered. You can use the following skeleton code: #include #include using namespace std; /to do: declare and define your print function Ent main() Save Al Answers " L Saue AJL Answers to save all answers.
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
write a c++
![ny Code or Tu Ions m your soution tha E
Consider the content of the following three text files:
1.txt
1234 33 22 567 4 -9-34
2.txt
10 122 -3 4O 331 22 5674-9 -34 99 100 203 -90
3.txt
-134 299 130 603 -19 1O
Manually create and store these files (on the online compiler) and write a C++ program that opens each file and:
1. Count the number of values
2. Create a dynamic array with size equal to the number of values in step1
3. Read the file content again and store it in the dynamically allocated array
The program will then sum up the array sizes in all files and dynamically create a big array with a size equal to the summation of the three sizes.
The program will then concatenate the three arrays into the big array (which is dynamically allocated with the correct size, again the size here is equal to the summation of the three sizes).
And print out all the arrays (define a print function to do that and call it from main())
Close all files and deallocate the arrays.
Example output:
Arr1 content:
1234 33 22 567 4 -9 -34
Arr2 content:
10 122 -3 40 331 22 567 4 -9-34 99 100 203 -9 0
Arr3 content:
-134 299 130 603 -19 10
ArrBig content:
1234 33 22 567 4 -9 -34 10 122 -3 40 331 22 567 4-9-34 99 100 203 -90-134 299 130 603 -19 10
Press any key to continue...
Note: your program must work correctly regardless of the number of values in each file. You cannot assume that the number of values in each file is fixed. If your program works only for the above example,
considered.
You can use the following skeleton code:
#include <iostream>
#include <fstream>
using namespace std;
Close
//to do: declare and define your print function
Save All Answers
int main()
Cua All Answers to save all answers.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F16b9166b-8646-4de0-ae3c-83a34b58bb8b%2F958a6d0a-596f-41f4-8bd5-5aab6bbc90e1%2Fk6wnz6s_processed.jpeg&w=3840&q=75)
Transcribed Image Text:ny Code or Tu Ions m your soution tha E
Consider the content of the following three text files:
1.txt
1234 33 22 567 4 -9-34
2.txt
10 122 -3 4O 331 22 5674-9 -34 99 100 203 -90
3.txt
-134 299 130 603 -19 1O
Manually create and store these files (on the online compiler) and write a C++ program that opens each file and:
1. Count the number of values
2. Create a dynamic array with size equal to the number of values in step1
3. Read the file content again and store it in the dynamically allocated array
The program will then sum up the array sizes in all files and dynamically create a big array with a size equal to the summation of the three sizes.
The program will then concatenate the three arrays into the big array (which is dynamically allocated with the correct size, again the size here is equal to the summation of the three sizes).
And print out all the arrays (define a print function to do that and call it from main())
Close all files and deallocate the arrays.
Example output:
Arr1 content:
1234 33 22 567 4 -9 -34
Arr2 content:
10 122 -3 40 331 22 567 4 -9-34 99 100 203 -9 0
Arr3 content:
-134 299 130 603 -19 10
ArrBig content:
1234 33 22 567 4 -9 -34 10 122 -3 40 331 22 567 4-9-34 99 100 203 -90-134 299 130 603 -19 10
Press any key to continue...
Note: your program must work correctly regardless of the number of values in each file. You cannot assume that the number of values in each file is fixed. If your program works only for the above example,
considered.
You can use the following skeleton code:
#include <iostream>
#include <fstream>
using namespace std;
Close
//to do: declare and define your print function
Save All Answers
int main()
Cua All Answers to save all answers.
![Consider the content of the following three text files:
1.txt
1234 33 22 567 4 -9 -34
2.txt
10 122 -3 40 331 22 567 4 -9 -34 99 100 203 -9 O
3.txt
-134 299 130 603 -19 10
Manually create and store these files (on the online compiler) and write a C++ program that opens each file and:
1. Count the number of values
2. Create a dynamic array with size equal to the number of values in step1
3. Read the file content again and store it in the dynamically allocated array
The program will then sum up the array sizes in all files and dynamically create a big array with a size equal to the summation of the three sizes.
The program will then concatenate the three arrays into the big array (which is dynamically allocated with the correct size, again the size here is equal to the summation of the three sizes).
And print out all the arrays (define a print function to do that and call it from main())
Close all files and deallocate the arrays.
Example output:
Arr1 content:
1234 33 22 567 4 -9 -34
Arr2 content:
10 122 -3 40 331 22 567 4-9-34 99 100 203 -9 0
Arr3 content:
-134 299 130 603 -19 10
ArrBig content:
1234 33 22 567 4 -9 -34 10 122 -3 40 331 22 567 4-9 -34 99 100 203 -90-134 299 130 603 -19 10
Press any key to continue...
Note: your program must work correctly regardless of the number of values in each file. You cannot assume that the number of values in each file is fixed. If your program works only for the above exam
considered.
You can use the following skeleton code:
#include <iostream>
#include <fstream>
using namespace std;
Save All Answers
//to do: declare and define your print function
int main()
d cuhmit. Click Save All Answers to save all answers.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F16b9166b-8646-4de0-ae3c-83a34b58bb8b%2F958a6d0a-596f-41f4-8bd5-5aab6bbc90e1%2F4gcsu2f_processed.jpeg&w=3840&q=75)
Transcribed Image Text:Consider the content of the following three text files:
1.txt
1234 33 22 567 4 -9 -34
2.txt
10 122 -3 40 331 22 567 4 -9 -34 99 100 203 -9 O
3.txt
-134 299 130 603 -19 10
Manually create and store these files (on the online compiler) and write a C++ program that opens each file and:
1. Count the number of values
2. Create a dynamic array with size equal to the number of values in step1
3. Read the file content again and store it in the dynamically allocated array
The program will then sum up the array sizes in all files and dynamically create a big array with a size equal to the summation of the three sizes.
The program will then concatenate the three arrays into the big array (which is dynamically allocated with the correct size, again the size here is equal to the summation of the three sizes).
And print out all the arrays (define a print function to do that and call it from main())
Close all files and deallocate the arrays.
Example output:
Arr1 content:
1234 33 22 567 4 -9 -34
Arr2 content:
10 122 -3 40 331 22 567 4-9-34 99 100 203 -9 0
Arr3 content:
-134 299 130 603 -19 10
ArrBig content:
1234 33 22 567 4 -9 -34 10 122 -3 40 331 22 567 4-9 -34 99 100 203 -90-134 299 130 603 -19 10
Press any key to continue...
Note: your program must work correctly regardless of the number of values in each file. You cannot assume that the number of values in each file is fixed. If your program works only for the above exam
considered.
You can use the following skeleton code:
#include <iostream>
#include <fstream>
using namespace std;
Save All Answers
//to do: declare and define your print function
int main()
d cuhmit. Click Save All Answers to save all answers.
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education