subject
Engineering, 21.12.2020 16:20 biba54

Files as Parameters and Character Data Retrieve program Grades. cpp and the data file graderoll. dat from the Lab 11 folder. The code is as follows: // FILL IN DIRECTIVE FOR FILES #include #include using namespace std; // This program reads records from a file. The file contains the following: student’s name, //two test grades and final exam grade. It then prints this information to the screen. const int NAMESIZE = 15; const int MAXRECORDS = 50; struct Grades // declares a structure to store information from file { char name[NAMESIZE + 1]; int test1; int test2; int final; }; typedef Grades gradeType[MAXRECORDS]; // This makes gradeType a data type that holds MAXRECORDS // Fill in the code for the prototype of the function readit // where the first argument is an input file, the second is the // array of records, and the third will hold the number of // records currently in the array. int main() { ifstream indata; indata. open("graderoll. dat"); int numRecord; // number of records to read in gradeType studentRecord; if(!indata) { cout << "Error opening file. \n"; cout << "It may not exist where indicated" << endl; return 1; } // fill in the code to call the function ReadIt. // output the information for (int count = 0; count < numRecord; count++) { cout << studentRecord[count].name << setw(10) << studentRecord[count].test1<< setw(10) << studentRecord[count].test2; cout << setw(10) << studentRecord[count].final << endl; } return 0; } // //This procedure reads records into an array of records from an input file and //keeps track of the total number of records //Declare inData: data file containing information to be placed in the array Page 63 of 80 //Declare dataout: an array of records and the number of records // void readIt (// FILL IN THE CODE FOR THE FORMAL PARAMETERS AND THEIR // DATA TYPES. (inData, gradeRec and total are the formal parameters) --total is passed by // re

ansver
Answers: 1

Other questions on the subject: Engineering

image
Engineering, 03.07.2019 15:10, brooklyn674
Apiston-cylinder with a volume of 0.25 m3 holds 1 kg of air (r 0.287 k/kgk) at a temperature of 100 c. heat transfer to the cylinder causes an isothermal expansion of the piston until the volume triples. how much heat is added to the piston-cylinder?
Answers: 3
image
Engineering, 04.07.2019 18:10, soreese02
An ideal otto cycle with air as the working fluid has a compression ratio of 8. the minimum and maximum temperatures in the cycle are 300 k and 1340 k. use constant specific heats at room temperature to determine (a) the amount of heat transferred to the air during the heat- addition kj/kg, (b) the thermal efficiency, and (c) the thermal efficiency of a carnot cycle ope limits. process, in rating between the same temperature
Answers: 2
image
Engineering, 04.07.2019 18:20, myahlit84
Inadequate stores control is not an obstacle to effective work order system. (clo4) a)-true b)-false
Answers: 3
image
Engineering, 04.07.2019 19:10, jennymares
Abarometer contains mercury with a density of 13600 kg/m3. atmospheric conditions are 95.8 kpa and 20 °c at 20 °c, the vapor pressure of the mercury is 0.000173 kpa. the column of mercury will rise to a height of most nearly. select one: a)- 0.38 m b)- 0.82 m c)- 0.48 m d)- 0.72 m
Answers: 1
You know the right answer?
Files as Parameters and Character Data Retrieve program Grades. cpp and the data file graderoll. dat...

Questions in other subjects:

Konu
Mathematics, 19.01.2021 08:30
Konu
SAT, 19.01.2021 08:30