Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Determine by hand the output of each program listed on the following pages using

ID: 652258 • Letter: D

Question

Determine by hand the output of each program listed on the following pages using the data files shown below.

Contents of data file:

9-15-20

Program:

#include <iostream>

#include< fstream>                                   

using namespace std;

int main ( void )

{

    int x,y,z;

    ifstream infile("E:dat2.in");

    infile >> x >> y >> z;

    cout << "x = " << x << endl<< "y = " << y << endl

         << "z = "<< z << endl;

    infile.close();

    return 0;

X = ?

Y = ?

Z = ?

Explanation / Answer

Contents of data file:
9-15-20
Program:
#include <iostream>
#include< fstream>                                 
using namespace std;
int main ( void )
{
    int x,y,z;
    ifstream infile("E:dat2.in");
    infile >> x >> y >> z;
    cout << "x = " << x << endl<< "y = " << y << endl
         << "z = "<< z << endl;
    infile.close();
    return 0;
}

x = 9
y = -15
z = -20

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote