Question: In C++, please. I will upvote Thank you! only edit from line 8 Lines 1-7 and lines 9- 19 cannot be changed. This program is

 In C++, please. I will upvote Thank you! only edit from

line 8 Lines 1-7 and lines 9- 19 cannot be changed. This

program is supposed to read from an input file and compute the

In C++, please. I will upvote Thank you! only edit from line 8

Lines 1-7 and lines 9- 19 cannot be changed.

This program is supposed to read from an input file and compute the total of the numbers it contains, writing the total to its output file. Fix it so that it works correctly. \( \begin{aligned} 1 & \text { \#include iostream> } \\ 2 & \text { \#include } \\ 3 & \text { using namespace std; } \\ 4 & \\ 5 & \text { int main() } \\ 6 & \{ \\ 7 & \text { ifstream in_file; } \\ 8 & \text { ifstream out_file; } \\ 9 & \\ 10 & \text { in_file.open("input.txt"); } \\ 11 & \text { int total }=0 ; \\ 12 & \text { int } n ; \\ 13 & \text { while (in_file }>>n)\{\text { total }=\text { total }+\mathrm{n} ;\} \\ 14 & \\ 15 & \text { out_file.open("output.txt"); } \\ 16 & \text { out_file }\langle19} return 0; buggy.cpp input.txt 121242

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!