Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In C language Instructions Write a program to approximate (using the Trapezoidal rule) the integral of rcos (r2) dr 0 by using N processes to

In C language image text in transcribed
Instructions Write a program to approximate (using the Trapezoidal rule) the integral of rcos (r2) dr 0 by using N processes to sum up n trapezoids (n>N). N should vary in the range of 1 to 8, while n will be input by the user. The parent process should create N(e[1.8), child processes using fork). There should be N pairs of pipes through which the parent process assigns jobs to associated child processes. and receives results back from them when the calculation is completed More specifically, the parent process will Initialy assign the first N pieces to the N child processes to do their respective calculation. Whenever a process has done its calculation of the area of another trapezoid, it will send it back to the parent process. Upon receiving such a piece, the parent process will update the sum accordingly and, if there are still un-calculated pleces, the parent vwill also assign the next piece to the just returned child process.After the parent has received all the n results, it prints out the final answer Some useful Points: 1. Use atof0 to convert from string to a numerica floating polnt value Example: double d- atof buffer): 2. Use sprintf) to convert from numerica floating point value to a string Example: sprintf(buffer,"6f, d)

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 Concepts

Authors: David Kroenke, David Auer, Scott Vandenberg, Robert Yoder

8th Edition

013460153X, 978-0134601533

More Books

Students also viewed these Databases questions

Question

(1 point) Calculate 3 sin x cos x dx.

Answered: 1 week ago

Question

What is the Definition for Third Normal Form?

Answered: 1 week ago

Question

Provide two examples of a One-To-Many relationship.

Answered: 1 week ago