Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Help need related C++ program in threads linux ! Thanx Given Test File : #!/bin/bash echo echo RMB echo ./p3 0 1100000000 1 echo

Help need related C++ program in threads linux ! Thanx

image text in transcribed

Given Test File :

#!/bin/bash

echo

echo "RMB "

echo

./p3 0 1100000000 1

echo

echo "----------------"

echo

echo

echo "RMB "

./p3 0 2200000000 1

echo

echo "----------------"

echo

echo

echo "RMB "

./p3 0 2200000000 2

echo

echo "----------------"

echo

echo

echo "RMB "

./p3 0 2200000000 4

echo

pwd

echo

Write a C++ program that performs the tasks described below. If there is just 1 command-line argument and it is -hw you should simply print hello world and then exit(0). Use pthreads to examine a range of integers *inclusive*. For each integer, compute its square root and then determine if the first digit after the decimal point is 7. For example: 127.677 # would NOT be counted 123.766 # would be counted **** The program should accept 3 command-line arguments: low value (inclusive) high value (inclusive) number of pthreads *to create* to perform the computation The mainline program should NOT participate in examining the range of integers. Instead, it should create the required number of threads and wait for them to complete the computation. It should then compute any final sum and print the results (see required format below). ./p3 0 9000000000 2 ## sample run: 0 to 9 Billion (INCLUSIVE); 2 threads alarm(90); //

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

Question

Explain why CDS are not insurance products. LO6

Answered: 1 week ago