hello There
Author |
Message |
thamilan
|
Posted: Wed Aug 13, 2008 7:21 pm Post subject: hello There |
|
|
i want to make a program in c :
but am a bit stuck, so can you anyone jst guide me through it.
Basically the program has to read in a whole paragraph, and the the program will have to find the words in the paragraph, then it has to sort the words into alphabetically order and and also count the number of times the word appeared in the paragraph and then print, the words in alphabetically order with the frequency.
cheers , if anyone can just guide me through it it would be good. Ps i have developed the sorting algorithm for the program... its an insertion sort. |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Dan
|
Posted: Wed Aug 13, 2008 7:45 pm Post subject: RE:hello There |
|
|
Well we can help better if you give it a try first and post your code.
You will need to learn about the fallowing (as a minum) to do it:
- file I/O or std (standard [keybord]) I/O if it is not from a file.
- Arrays (or a hash table, map or dictionray type data structer of some kind) to store the words.
- Functions, at least a function for the sorting algorithm
- An implmentation of insertion sort in C (you should probly make this your self if this is an assigment).
- Some kind of loop to go threw the words in the paragraph. Idealy a tokenizer of some kind in a foreach type loop. (Assuming you do not do the stroing and/or sorting of the words as they are being input).
|
Computer Science Canada
Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more! |
|
|
|
|
michaelp
|
|
|
|
|
CodeMonkey2000
|
Posted: Wed Aug 13, 2008 8:39 pm Post subject: RE:hello There |
|
|
Using C++ for this would be a lot easier. With C you might need to implement some sort of linked list structure, or something with dynamic memory allocation, since you don't know how many words there are. |
|
|
|
|
|
Tony
|
Posted: Wed Aug 13, 2008 9:15 pm Post subject: RE:hello There |
|
|
Using Python or Ruby or anything that supports working with text would be a lot easier. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
md
|
Posted: Wed Aug 13, 2008 9:44 pm Post subject: RE:hello There |
|
|
Awk would be great for this. |
|
|
|
|
|
wtd
|
Posted: Wed Aug 13, 2008 9:59 pm Post subject: RE:hello There |
|
|
Paying one of us several hundred dollars to do it for you would be tremendously easier. |
|
|
|
|
|
md
|
Posted: Wed Aug 13, 2008 10:00 pm Post subject: RE:hello There |
|
|
I'll do it for less then wtd. $100 |
|
|
|
|
|
Sponsor Sponsor
|
|
|
|
|