Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

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++11 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
1,5,10
It would print:
avg is 5.33
The largest number is 10
The smallest number is 1
The minimum amount of numbers a person can pass is 1. 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

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_2

Step: 3

blur-text-image_3

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

More Books

Students also viewed these Databases questions