Question: Write a Cor C++ program A6p3.c (or A6p3.cpp) that accepts one command line argument which is an integer n between 2 and 4 inclusive. Generate

 Write a Cor C++ program A6p3.c (or A6p3.cpp) that accepts one

Write a Cor C++ program A6p3.c (or A6p3.cpp) that accepts one command line argument which is an integer n between 2 and 4 inclusive. Generate a string of 60 random lower case English characters and store them in a char array. Use pthread to create n threads to convert the string into all upper case. (You may call the toupper and tolower functions declared in ctvpe.h). You should divide this conversion task among the n threads as evenly as possible. Print out both the lower case and upper case version of the string in separate lines. (That is, 60 lower case English characters in one line and another 60 corresponding upper case English characters on another line.) (35 points) (Note: if you do not use pthread to divide the conversion task among the threads, you will get zero points.)

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!