Question: Write a multithreaded program that calculates various statistical values for a list of numeric values. Use the C + + 1 1 std::thread code. This
Write a multithreaded program that calculates various statistical values for a list of numeric values. Use the C std::thread code.
This program is passed a series of numbers on the command line. This program will then create three separate worker threads: one will
determine the average of the numbers, a second and third will determine the maximum and minimum values respectively
For example, if your program is passed the integers
It would print:
avg is
The largest number is
The smallest number is
The minimum amount of numbers a person can pass is There is no maximum number of values the person can enter. If the person does
not pass any numbers show an error instead of creating threads. Only use the amount of space that you need, and do not allocate extra.
When you make each thread use a different method. One should use function pointers, one should use functors and the last should use
lambdas
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
