Starting from:
$35

$29

Homework #3 Solution




Create a program uses "system" to call "WGET" to download the file (http://rmarsh.cs.und.edu/CLASS/CS451/HOMEWORK/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 in advance (its 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 13 points.




REQUIREMENTS:

‐‐‐‐‐‐‐‐‐‐‐‐‐

 
Your program must run in Streibel 109.




 
Your full name must appear as a comment at the beginning of your program.




 
Your source code must be named hw3‐yourname.c




3. Email your source (subject hw3‐yourname) to rmarsh@cs.und.edu








































































More products