Engineering
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

answer
Answers: 1

Other questions on the subject: Engineering

image
Engineering, 03.07.2019 23:20, abbz13
Two technicians are discussing the intake air temperature (iat) sensor. technician a says that the computer uses the iat sensor as a backup to the engine coolant temperature (ect) sensor. technician b says that the powertrain control module (pcm) will subtract the calculated amount of fuel if the air measures hot. who is correct
Answers: 3
image
Engineering, 04.07.2019 18:10, meganwintergirl
Afour cylinder four-stroke in-line engine has a stroke of 160mm, connecting rod length of 150mm, a reciprocating mass of 3kg and its firing order is 1-3-4-2. the spacing between cylinders is 100mm. i. show that the engine is in balance with regard to the primary inertia forces and primary 3. a and secondary inertia couples. li determine the out of balance secondary inertia force ii. propose ways of balancing this out of balance force and discuss the challenges that will arise
Answers: 3
image
Engineering, 04.07.2019 18:10, wyattlb97
Water at the rate of 1 kg/s is forced through a tube with a 2.5 cm inner diameter. the inlet water temperature is 15°c, and the outlet water temperature is 50°c. the tube wall temperature is 14°c higher than the local water temperature all along the length of the tube. what is the length of the tube?
Answers: 3
image
Engineering, 04.07.2019 18:10, mamasbug4285
An air compression refrigeration system is to have an air pressure of 100 psia in the brine tank and an allowable air temperature increase of 60°f for standard vapor compression cycle temperatures of 77 f entering the expansion cylinder and 14 f entering the compression cylinder, calculate the coefficient of performance a. 2.5 b 3.3 c. 4.0 d. 5.0
Answers: 3
Do you know the correct answer?
Files as Parameters and Character Data Retrieve program Grades. cpp and the data file graderoll. dat...

Questions in other subjects:

Konu
Mathematics, 03.02.2021 01:00