Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please complete the c++ code. The code that needs completing is outlined in the comments. #include #include #include struct student{ int id; int score;}; struct

Please complete the c++ code. The code that needs completing is outlined in the comments.

#include

#include

#include

struct student{

int id; int score;};

struct student* allocate(){

/*Allocate memory for ten students*/

/*return the pointer*/

}

void generate(struct student* students){

/*Generate random and unique ID and scores for ten students, ID being between 1 and 10, scores between 0 and 100*/

}

void output(struct student* students){

/*Output information about the ten students in the format: ID1 Score1 ID2 score2 ID3 score3 ... ID10 score10*/

}

void summary(struct student* students){

/*Compute and print the minimum, maximum and average scores of the ten students*/

}

void deallocate(struct student* stud){

/*Deallocate memory from stud*/

}

int main(){

struct student* stud = NULL;

/*call allocate*/

/*call generate*/

/*call output*/

/*call summary*/

/*call deallocate*/

return 0;

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing

Authors: David M. Kroenke, David Auer

11th Edition

B003Y7CIBU, 978-0132302678

More Books

Students also viewed these Databases questions