C++ Programming. 1)Using a text editor, create a text1.txt file and fill it with words from Latin letters (at least 30 words). The number1.txt file is programmatically filled with random integers belonging to the range from -100 to 100. The number of numbers in the file is set from the keyboard. The number of numbers in each line is an arbitrary number in the range from 0 to 10 and is set using the rand() function. Print numbers to the console, preserving line breaks corresponding to number1.txt. When implementing the program, it is necessary to fill the number1.txt file with random integers using a header file containing a function for filling the file. When working with a file filled with words, you can use the functions for working with strings. When outputting the result to the number3.txt file, keep the line breaks. Write to the file total.txt first all the elements of the file number2.txt, right-aligned, and then all the elements of the file text2.txt, center-aligned. Rename the file total.txt (the new file name is entered from the keyboard). Print to the console first all the elements of the file number2.txt, right-aligned, and then all the elements of the file text2.txt, center-aligned. 2)Find the difference between pairs of adjacent elements of the number1.txt file. Output the result to the number3.txt file and to the console. At the end of the number2.txt file, add the words "Result = " and the number of elements equal to zero, output the result to the console and and the number of elements divisible by 5, output the result to the console. Replace all words of the text1.txt file with reverse ones (for example, replace kot with tok), output to the text2.txt file.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter5: Repetition Statements
Section5.3: Interactive While Loops
Problem 6E: (Conversion) a. Write a C++ program to convert meters to feet. The program should request the...
icon
Related questions
Question

C++ Programming.

1)Using a text editor, create a text1.txt file and fill it with words from Latin letters (at least 30 words).
The number1.txt file is programmatically filled with random integers belonging to the range from -100 to 100. The number of numbers in the file is set from the keyboard. The number of numbers in each line is an arbitrary number in the range from 0 to 10 and is set using the rand() function. Print numbers to the console, preserving line breaks corresponding to number1.txt.
When implementing the program, it is necessary to fill the number1.txt file with random integers using a header file containing a function for filling the file. When working with a file filled with words, you can use the functions for working with strings. When outputting the result to the number3.txt file, keep the line breaks.
Write to the file total.txt first all the elements of the file number2.txt, right-aligned, and then all the elements of the file text2.txt, center-aligned. Rename the file total.txt (the new file name is entered from the keyboard).
Print to the console first all the elements of the file number2.txt, right-aligned, and then all the elements of the file text2.txt, center-aligned.

2)Find the difference between pairs of adjacent elements of the number1.txt file. Output the result to the number3.txt file and to the console. At the end of the number2.txt file, add the words "Result = " and the number of elements equal to zero, output the result to the console and and the number of elements divisible by 5, output the result to the console. Replace all words of the text1.txt file with reverse ones (for example, replace kot with tok), output to the text2.txt file.

Expert Solution
steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Knowledge Booster
Types of Function
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.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning