Starting from:
$30

$24

HW 06 Solution

In 1868 the stapler was patented in England by C. H. Gould.

Also, in 1899 the 1st performance of Edward MacDowell's 2nd

Concerto in D occured. Wow!




Write a program to generate a A tag cloud (see

http://en.wikipedia.org/wiki/File:Web_2.0_Map.svg)




The program must use a command-line argument (argv and argc)

to specify the filename to be loaded (hw6.data). After

checking for a validMark set

command-line entry, your program must

open the file and read in each word to see how many words

there are. Then, using a dynamically allocated array of

structures, re-read in each word and store it in the

dynamically allocated array of structures. Use rewind to

rewind the file. Do NOT close and reopen the file.




Once you have each word stored, scan the array of structures

to find out how many repeating words their are. Or more

importantly, how many times does each word appear (there are

a number of ways to do this and I leave it up to you to

come with an workable approach).




Sort the array of structures such that the top 10 occurring

words can be determined and listed on the screen. So the

output would look like this:




word1 occurences

word2 occurences

. .

. .

. .




Note the even spacing, this is required and accomplished by

including a tab "\t" in the printf statement.







NOTES:

------

1) The struct must hold an int and a char[50].




2) Some words will have their first character uppercase due to

being at the beginning of a sentence, so you must correct for

uppercase first characters.




3) Some words will have punctuation marks for their last character,

so you must remove those punctuation marks.




REQUIREMENTS:

-------------

1. Your program must 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 hw6-yourname.c

More products