subject

Just complete the program where it say fill in the code.#include // 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{char name[namesize + 1]; int test1; int test2; int final; }; typedef grades gradetype[maxrecords]; // this makes gradetype a data type// that holds maxrecords// grades structures.// 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 read ingradetype 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 informationfor (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; } readit task: this procedure reads records into an array of// records from an input file and keeps track of the// total number of records// data in: data file containing information to be placed in// the array// data out: an array of records and the number of recordsvoid 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 reference){total = 0; indata. get(graderec[total].name, namesize); while (indata){// fill in the code to read test1// fill in the code to read test2// fill in the code to read finaltotal++; // add one to total// fill in the code to consume the end of line// fill in the code to read name}}

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 02:30
The can be used to paste text in any order
Answers: 1
question
Computers and Technology, 22.06.2019 12:40
The most complicated four letter word
Answers: 1
question
Computers and Technology, 23.06.2019 00:00
How do we use the sumif formula (when dealing with different formats) ?
Answers: 1
question
Computers and Technology, 23.06.2019 03:00
What are the different parts of computer
Answers: 2
You know the right answer?
Just complete the program where it say fill in the code.#include // fill in directive for files#incl...
Questions
question
Mathematics, 14.04.2021 17:00
question
Chemistry, 14.04.2021 17:00
question
Chemistry, 14.04.2021 17:00
question
Mathematics, 14.04.2021 17:00
question
Mathematics, 14.04.2021 17:00
question
Chemistry, 14.04.2021 17:00
question
Mathematics, 14.04.2021 17:00
question
Mathematics, 14.04.2021 17:00
Questions on the website: 13722361