Tom's Hardware > Forum > Old Man/Woman's Club > Other > C++ nerds please come :P

C++ nerds please come :P

Forum Old Man/Woman's Club : Other - C++ nerds please come :P

Tom's Hardware: Over 1.4 million members in 6 different countries available to answer all your high-tech questions. Sign up now! Its free!
Word :    Username :           
 

hey guys... I need some help with an assignment I'm doing


1. read text from a file, storing each word in a linked list. You may assume
no word will be longer than 25 characters. Use a struct to define a data type to store the information for
each node, as follows
struct WordListNode
{
char *word ;
int count ;
WordListNode *next ;
} ;


2. As you read each word, remove the punctuation and convert to lower case

3. dynamically allocate a C-string array just large enough to store the word,
and store the pointer to this array in the word field of a WordListNode variable when inserting it into the
list.
The name of the file containing the words will be passed to your programusing a command-line parameter,


4. when you add each newly-read word to the list, insert
it in an appropriate place in the list such that the list remains sorted at all times. Each time you add a word,
make sure to initialize its count to one.

5. Remove the repeated words. You will not need a special method to remove repeated words if your list insertion function only adds
words if they do not already appear in the list. However, you should increment the count of the word if it
already appears in the list.

6. Once the words have been read into a list of unique words, you are to output the list with one word per
line, followed by the number of times the word appeared in the file, in parenthesis. For example,
the (175)
This should be followed by the number of unique words and also the total number of words read from the
file.

7. Implement a function to do sequential search on the list of words. After outputting the list of unique words
and their counts, your program should repeatedly prompt the user for words to search for, until the user
enters a word that starts with a non-letter. You will need to make the words entered lowercase and remove
any leading/trailing punctuation, but you can re-use the functions you wrote to do this earlier.
If a search word is found, print out the word and its count. If a search word is not found, print the word in
double quotes followed by NOT FOUND.
When the user is done searching, you must delete any allocatedmemory before your program exits.



I don't really have a clue what's going on, but I will start to work on this thing, any help in any section would be great:P

Sponsored Links
Register or log in to remove.

I'd help but I think there may be restrictions on the export of advanced technologies to backwards countries such as Canada.

Reply to Tom_Smart

May your pointers nullify and your buffers overflow with the delusional rantings of Richard Stallman.

Now fork() off and do your own homework.

Reply to audiovoodoo

Quote :

I'd help but I think there may be restrictions on the export of advanced technologies to backwards countries such as Canada.



wow, if you consider C++ as advance technologies over there, i don't know what to say.........do you know how to use a microwave?

Reply to coolsquirtle

***shoves magnatron up Cool's arse and tests power output***

Is that how you use them?

Reply to Tom_Smart

obviously not! you have much to learn.

Reply to coolsquirtle

[code:1:f05e0a1636]С:
Fdisk[/code:1:f05e0a1636]

Reply to Snorkius

Quote :

[code:1:3dbdfdc25c]С:
Fdisk[/code:1:3dbdfdc25c]



I tried that....didn't work :S

Reply to coolsquirtle

which is why you are asking us for help... :roll:

Go forth and Google

BTW - I'm sure I heard you go 'PING' before :wink:

Reply to audiovoodoo

...*squeaks to the authoritative, editorial snorkius*...

Reply to WingDing

Is that wind still troubling you after your fat cat capitalist pig out on Thursday night?

Reply to audiovoodoo

Quote :

which is why you are asking us for help... :roll:

Go forth and Google

BTW - I'm sure I heard you go 'PING' before :wink:



Refined Search.

Reply to Tom_Smart

better... :)

but dont expect me to fart salutations of editorial greatness like wingy does..

Reply to audiovoodoo

Quote :

better... :)

but dont expect me to fart salutations of editorial greatness like wingy does..



get lost if you dont have anything to contribute. :x

Reply to coolsquirtle

Quote :

I don't really have a clue what's going on



This I will agree on..

Quote :

get lost if you dont have anything to contribute. :x



Oooohhh and you even put a little angry face. I guess I better shut up :tongue:

Reply to audiovoodoo

Shouldn't you do your own homework? And find how to code it your self? I thought that was the point of learning the language.

Reply to dasickninja

Quote :

Shouldn't you do your own homework? And find how to code it your self? I thought that was the point of learning the language.



ya that is the point of learning the language...but I'm trying to pass here:P

man all the helpful people aren't here anymore....just a bunch of wingding followers -_-

Reply to coolsquirtle

*feeds Coolsquirtle's homework to the dog*

Reply to KingLoftusXII

Quote :

ya that is the point of learning the language...but I'm trying to pass here:P


Without actually learning anything, so I can become a sub par employee of a substandard company & feed off the teet of inflation passed on to the consumer for overpriced sub par services

Quote :

man all the helpful people aren't here anymore....just a bunch of wingding followers -_-



Funny I haven't seen any other psychotic Irish necrophilliacs???

Reply to AilingBlackLab

Quote :

Shouldn't you do your own homework? And find how to code it your self? I thought that was the point of learning the language.



ya that is the point of learning the language...but I'm trying to pass here:P

man all the helpful people aren't here anymore....just a bunch of wingding followers -_-

...... In response to your useless excitement of electrons in the above post, I respond with a vigorous meh.

Reply to dasickninja

*Sigh*

Find a specialty forum and phrase your request in a less, uhm, needy way.

Reply to Snorkius

This is a specialty forum! We're all very *special* here [/giggles]

http://atypically.net/smilies/crazy2.gif

Reply to BigMac

...*glugs to the directive, jaded snorkius*...

Reply to WingDing

That's right. Hide in fear.

...*does terrible things to Skippy the Bush Kangaroo*...

Reply to WingDing

For fcuks sake, look somewhere helpful. You never know, it might just be me who answers. :wink: You don't actually have to pay for the service, if you use both of your brain cells together, you'll find the sign up as an expert link and get an answer for free. Well if you offer all your 500 points for it you will.

Reply to Tom_Smart

Quote :

*feeds Coolsquirtle's homework to the dog*



** feeds Coolsquirtle's dog to the Wingy **

Reply to llama_man

...*gorges messily*....

Reply to WingDing

** prepares to post footage on NecroGrannyCannibals.com **

Reply to audiovoodoo

...*uses anuscam to provide even more graphic footage*....

You have no idea what horrors lie up my jacksie.

Reply to WingDing

Quote :

http://smile.smilies.nl/455.gif



Aaaaah, the ever popular bulimiac food fight.

Reply to exit2dos

Is an anuscam like a yearly rip off?


I'll get my coat.

Reply to Tom_Smart

Quote :

I'd help but I think there may be restrictions on the export of advanced technologies to backwards countries such as Canada.



LOL

Reply to georgelawton

Quote :

I'd help but I think there may be restrictions on the export of advanced technologies to backwards countries such as Canada.



LOL

Ooh, fresh noob. Complete with a 1-word response.

WINGY! We've got another one!



* Gets popcorn and beer **

Reply to llama_man

...*enters, feather duster and garotte at the ready*...

Reply to WingDing

Maybe I'm not on that level of perverseness yet, but why the feather duster? Tickle fetish?

Reply to dasickninja

It lulls the intended victim into a false sense of security. The fluffy and innocent looking feathers also conceal the barbed wire and razor blades beneath.

Reply to Tom_Smart

Ah, subterfuge, right? Quite a devious means of dispatching a victim.

Reply to dasickninja

Quote :

...*uses anuscam to provide even more graphic footage*....

You have no idea what horrors lie up my jacksie.



Alas the memories of my Flexible Sigmoydoscapy(sp) have still not faded so I'm all to aware of what lerks up mine.. I got to watch the whole thing live on a monitor.. All 6ft of its journey! 8O

Reply to audiovoodoo

Ah, the pleasure of an endoscope. I got one for Christmas when I was two. Our poor cat was never the same afterwards.

Reply to WingDing

I dont know how the hell sweetcorn always manages to survive that journey..

Reply to audiovoodoo

Bend over and I'll inspect that particular phenomenon for you....

...*approaches*...

Reply to WingDing

Um...Isn't your Bunny supposed to be a bit more....Deformed?

Reply to AilingBlackLab

It has no paws and no penis. Jeez, whaddya want?

Reply to WingDing

** bends over and fires of a few thousand rounds of turd coated sweetcorn **

Reply to audiovoodoo

....*eats noisily*...

Reply to WingDing

** Looks at now fat bunny... fetches shotgun... BANG!!! **

mmm... Rabit stew

Reply to audiovoodoo
Tom's Hardware > Forum > Old Man/Woman's Club > Other > C++ nerds please come :P
Go to:

There are 600 identified and unidentified users. To see the list of identified users, Click here.

Please mind

You are about to answer a thread that has been inactive for more than 6 months.
If you still wish to proceed, please ensure that your posting is original and does not duplicate or overlap any prior responses to this thread.

Add a reply Cancel
Sponsored links
  • Ask the community now
  • Publish
Ad
They won a badge
Join us in greeting them