Question: in C++ Write the code that does the following: 1. Opens an output file with the filename results.txt' as output only, and opens an input

 in C++ Write the code that does the following: 1. Opens
in C++

Write the code that does the following: 1. Opens an output file with the filename results.txt' as output only, and opens an input file named incoming.txt' as input only. You will begin this problem writing the statements for that, 2. There is 1 or more records in this input file. Use a loop to go through the file and read each line of input. The input consists of a 3 digit number that you will read into an integer type variable 3. Divide each integer that was input from the file by 2, and then weite that result to the output fite. Make sure you retain the decimals after dividing 4. After the end of your loop close the files. Do not write an entire program. Begin with the two open file statements (no testing for errors required, define any variable(s) you need, code the loop, then write the close statements. That's all should not be more than about 8 to 10 lines of code

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!