Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a Perl program that will do the following: It will accept three comm and-line arguments: (1) The first will be a beginning number for

Write a Perl program that will do the following:

It will accept three command-line arguments:

(1) The first will be a beginning number for a range of random numbers to be generated.
(2) The second will be an ending number for a range of random numbers to be generated.
(3) The third will be how many random numbers each process should generate.

For example, if the call to the program wasmark-a11.pl 100 1000 200

The program should create four child processes. Each process should generate 200 random numbers between 100 and 1000.

After the parent process creates the child processes, it should wait so that the child processes can finish. The child processes should send the sum of its generated numbers to the parent using a pipe. The parent should compute the global mean of all the data (rounded to the nearest tenth) and send that mean back to each of the four child processes using the pipe. Each child process will display a single line (shown at bottom of report) summarizing its statistics.

The parent process should generate a report heading (to the screen). The entire output looks like this:

image text in transcribed
Range of numbers: 100 through 1000 Numbers generated by each process: 200 Global Mean (rounded nearest tenth) : 547.2 to Analysis compared to the global mean: PID Mean Below Process Above 0 1 14921 14922 14923 14925 552.1 553.7 549.8 549.0 94 105 101 103 106 94 99 2 3 97

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

Students also viewed these Databases questions

Question

Use the general approach to problem-solving groups.

Answered: 1 week ago

Question

manageremployee relationship deteriorating over time;

Answered: 1 week ago