Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

USE C to ANSWER N students are sitting around a table. They are numbered 1 through N. There is a bowl of chocolates in the

USE C to ANSWER

N students are sitting around a table. They are numbered 1 through N. There is a bowl of chocolates in the center of the table, and each student around the table takes a single piece of chocolate, one at a time in ascending order, starting with someone specified in the input. You will need to determine which student does not get to choose a chocolate from the bowl.

The input file will have 3 numbers. The first number is the number of students at the table. The second number is the number of chocolates in the bowl. The third number represents the student that will take the first chocolate from the bowl. The first name of each student sitting at the table is also in the input.

FUNCTIONS TO IMPLEMENT

char** readData(FILE*, int*, int*, int*);

The FILE is the file pointer for the input file. The int*s represent the number of students, the number of chocolates in the bowl, and the number that represents the student that will be the first to choose a chocolate from the bowl. This function will read the three integers, then the names of the students. The names will be stored in a 2d character array. Because you do not know the number of students at compile time, you must dynamically allocate a 2d character array for the student names

void Winner(int, int, int, char**);

void printStudents(int , char**);

void freeMemory(char**, int);

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_2

Step: 3

blur-text-image_3

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

Spatio Temporal Database Management International Workshop Stdbm 99 Edinburgh Scotland September 10 11 1999 Proceedings Lncs 1678

Authors: Michael H. Bohlen ,Christian S. Jensen ,Michel O. Scholl

1999th Edition

3540664017, 978-3540664017

More Books

Students explore these related Databases questions

Question

2. The model is credible to the trainees.

Answered: 3 weeks ago