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++ 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.
Step by step
Solved in 4 steps with 4 images