Sale!

HW-3 CS451 Solved

Original price was: $35.00.Current price is: $30.00. $25.50

Category:

Description

5/5 - (7 votes)

Create a program uses “system” to call “WGET” to download the file
http://undcemcs01.und.edu/~ronald.marsh/CLASS/CS451/hw3-data.txt .

The program must then open and load the file into a character array.
However, you must assume that you do not know the size of the
hw3-data.txt file in advance (it’s size will change when we test your
program). Therefore, your program must somehow determine the size of
the file, create a dynamic array large enough, and load the data into
the array. As you load the array it would be wise to also convert all
uppercase characters to lowercase at this time.

Once you have the array populated create 2 threads (see UNIX notes on
website). One thread must search for all occurences of the word “easy”.
The second thread must search for all occurences of the word “polar”.
Both threads must also display the number of occurences of each word.

* Don’t forget to delete the dynamic array once you no longer need it.

* While you could do this assignment without threads, doing so will
cost you at least 15 points.

REQUIREMENTS:
————-
1. Your program must compile and run on Linux Mint.
2. Your full name must appear as a comment at the beginning of your program.
3. Your source code must be named hw3-yourname.c or hw3-yourname.cpp
4. Your source MUST compile using “gcc hw3-yourname.c -pthread” or
“g++ hw3-yourname.cpp -lpthread”
5. Failure to follow the above 4 directions will result in
loss of points.