please help. what is missing?
Function: This program follows this algorithm:
// (1) Read an integer value Num from the keyboard.
// (2) Open an input file named 'second'.
// (3) Read three integer values from the file.
// (4) Compute the sum of the three values.
// (5) Add Num to the sum.
// (6) Display the sum.
//
//
--------------------------------------------------------------------------
#include
#include
#include
using namespace std;
int main()
{
// ****** The lines put data into two input files.
system("rm -f first; echo 7 2 5 4 8 > first"); //DO NOT TOUCH
...
system("rm -f second; echo 21 7 2 9 14 > second"); //DO NOT
TOUCH ...
//
--------------------------------------------------------------------
// WARNING: DO NOT ISSUE PROMPTS or LABEL OUTPUT.
//
--------------------------------------------------------------------
ifstream infile;
infile.open("second");
int a, s, d, sum;
infile >> a >> s >> d;
sum = a+s+d;S
cout << sum;
cout << endl; return 0; // DO NOT MOVE or DELETE.
}
please help. what is missing? Function: This program follows this algorithm: // (1) Read an integer value Num from the k
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am