Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

There are 10 students enrolled in a course. The course covers x number of chapters from a textbook ( x > 1). In each chapter

There are 10 students enrolled in a course. The course covers x number of chapters from a textbook (x > 1). In each chapter y number of homework(s) are assigned (y 1). The average grade for each homework in all the chapters need to be found out.

To solve this, write program which has the main process as Director process, which reads a file containing grades of all homeworks of all chapters and creates x number of Manager processes. Each Manager process will take care of solving a chapter. Each manager process will create y number of Worker process and pass one homework to each of them and they calculate and print the average.

The input file should contain the data according to the value of x and y. For example, the input text file and the process tree for x = 2 and y = 2 will look like the following:

image text in transcribed

The Director process is responsible for opening and closing the input text file. It stores the values in a two dimensional integer array with 10 rows. You may need to use the following C functions (in addition to the necessary file & process management system calls): fopen(), fscanf(), fseek(), fclose().

File Edit View Search Tools Documents Help Director quiz-grades 19 17 20 18 9 6 109 2 11 10 16 3 7 9 10 Manager 1 Manager 2 15 13 15 15 20 18 18 16 17 19 19 18 3 15 14 12 0 13 18 15 Worker 1 Worker 2 Worker3 Worker4 File Edit View Search Tools Documents Help Director quiz-grades 19 17 20 18 9 6 109 2 11 10 16 3 7 9 10 Manager 1 Manager 2 15 13 15 15 20 18 18 16 17 19 19 18 3 15 14 12 0 13 18 15 Worker 1 Worker 2 Worker3 Worker4

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

Beyond Big Data Using Social MDM To Drive Deep Customer Insight

Authors: Martin Oberhofer, Eberhard Hechler

1st Edition

0133509796, 9780133509793

More Books

Students also viewed these Databases questions

Question

What can Chandra do to correct her mistake?

Answered: 1 week ago

Question

=+2 How does the preparation and support for each type of IE vary?

Answered: 1 week ago

Question

=+What is the extent of the use of each type of IE?

Answered: 1 week ago