Menu

[Solved]4 105 210 106 212 107 214 108 216 Generate Data Format Correct Code Question 1 Options Fpr Q37180101

4

10.5 21.0

10.6 21.2

10.7 21.4

10.8 21.6

To generate the data format above, the correct code is

Question 1 options:

fprintf(dataout,”%drn”,num_of_data);

for(i=1;i<4;i++)

    fprintf(fdataout,”%4.1lf   %4.1lfrn”,10.1+i,2.0*(10.1+i));

fprintf(dataout,”%drn”,num_of_data);

for(i=0;i<4;i++)

    fprintf(fdataout,”%4.1lf   %4.1lfrn”,10.5+i,2.0*(10.5+i));

fprintf(dataout,”%dn”,num_of_data);

for(i=0;i<4;i++)

    fprintf(fdataout,”%4.1lf   %4.1lfn”,10.1+i,2.0*(10.1+i));

Question 2 (10 points)

Saved

Given the text file below :

10
0.0 132.5
0.1 147.2
0.2 148.3
0.3 157.3
0.4 163.2
0.5 158.2
0.6 169.3
0.7 148.2
0.8 145.1

What is the first data (10) supposed to be ?

Question 2 options:

the first data of the file

the start address which fscanf needs to read from

the end address which fscanf needs to stop reading

the number of valid data

Question 3 (10 points)

Saved

Does the following data have the correct content ?

10
0.0 132.5
0.1 147.2
0.2 148.3
0.3 157.3
0.4 163.2
0.5 158.2
0.6 169.3
0.7 148.2
0.8 145.1

Question 3 options:

Yes because it has the right number of data

No, because the first data is missing its pair

No, because the number of data doesn’t match with the header

No, because the first data is missing its pair and the datadoesn’t match with the header

Question 4 (10 points)

Saved

Given the text file below :

0.0 132.5
0.1 147.2
0.2 148.3
0.3 157.3
0.4 163.2
0.5 158.2
0.6 169.3
0.7 148.2
0.8 137.6
0.9 135.9
-99 -99

What is the last data (-99 -99) supposed to be ?

Question 4 options:

The number of data

The last data of the file

The trailer signal and also the last data of the file

Trailer signal

Question 5 (10 points)

Saved

After a file is successfully opened, the command needed toconclude the file reading/writing process is

Question 5 options:

return 0;

close(file);

stop();

fclose(file);

Expert Answer


Answer to 4 10.5 21.0 10.6 21.2 10.7 21.4 10.8 21.6 To generate the data format above, the correct code is Question 1 options: fpr… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *