Question: 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:
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:
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
Get step-by-step solutions from verified subject matter experts
