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

Another question on Engineering

question
Engineering, 03.07.2019 14:10
Amass of 1.5 kg of air at 120 kpa and 24°c is contained in a gas-tight, frictionless piston-cylinder device. the air is now compressed to a final pressure of 720 kpa. during the process, heat is transferred from the air such that the temperature inside the cylinder remains constant. calculate the boundary work input during this process.
Answers: 2
question
Engineering, 04.07.2019 03:10
What precautions should you take to prevent injuries when dealing with heavy loads?
Answers: 1
question
Engineering, 04.07.2019 18:10
Carbon dioxide gas expands isotherm a turbine from 1 mpa, 500 k at 200 kpa. assuming the ideal gas model and neglecting the kinetic and potential energies, determine the change in entropy, heat transfer and work for each kilogram of co2.
Answers: 2
question
Engineering, 04.07.2019 18:10
Journeyman training is usually related (clo2) a)-to specific tasks b)-to cost analysis of maintenance task c)-to control process to ensure quality d)-to installation of machinery
Answers: 2
You know the right answer?
Files as Parameters and Character Data Retrieve program Grades. cpp and the data file graderoll. dat...
Questions
question
Mathematics, 29.04.2021 21:10
question
Social Studies, 29.04.2021 21:10
question
Mathematics, 29.04.2021 21:10
question
Mathematics, 29.04.2021 21:10
Questions on the website: 13722362