Question: Write a multithreaded program in c++ or c that calculates the minimum, maximum, and average values of a series of numbers read from a file

 Write a multithreaded program in c++ or c that calculates the

Write a multithreaded program in c++ or c that calculates the minimum, maximum, and average values of a series of numbers read from a file specified as command line input. In the first step randomly generate 15,000 numbers between -200 and 200 and store them in the file. Seed the random number generator with time. In the second step create three separate threads for computing minimum, maximum, and average values. The threads return the values to the parent thread which will print the results. Time the execution and print the value. Within the same program implement another version which does not use any threads and print the results. Time the execution and print the value. Compare the times taken with and without threads. Finally display which solution is better $/osproj2c file.txt With Threads The minimum is The maximum is The average is Time taken is seconds Without Threads The minimum is The maximum is The average is Time taken is- seconds The solution with -- is better

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!