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, 04.07.2019 18:10
Different types of steels contain different elements that alter the characteristics of the steel. for each of the following elements, explain what the element does when alloyed with steel.
Answers: 2
question
Engineering, 04.07.2019 18:10
Water in a partially filled large tank is to be supplied to the roof top, which is 8 m above the water level in the tank, through a 2.2-cm-internal-diameter pipe by maintaining a constant air pressure of 300 kpa (gage) in the tank. if the head loss in the piping is 2 m of water, determine the discharge rate of the supply of water to the roof top in liters per second.
Answers: 3
question
Engineering, 04.07.2019 18:20
Determine the damped natural frequencies and the steady state response of a decoupled damped forced two degrees of freedom system. 10ä1 + 2q1 20q1 10 cos t; 10q2 +4q2 + 40q2 10 cos t
Answers: 3
question
Engineering, 04.07.2019 19:20
The power source in a certain welding setup generates 3500w that is transferred to the low carbon steel work with a heat transfer factor of 0.85. the melting factor in the operation is 0.45. a continuous fillet weld is to be made with a cross-sectional area of 23 mm2 determine the travel speed at which the welding can be accomplished.
Answers: 3
You know the right answer?
Files as Parameters and Character Data Retrieve program Grades. cpp and the data file graderoll. dat...
Questions
question
Computers and Technology, 28.07.2019 21:30
question
Mathematics, 28.07.2019 21:30
Questions on the website: 13722360