Link to home
Start Free TrialLog in
Avatar of wongmlai
wongmlai

asked on

counts how many times each word occurs

stores each word in the article in the two-dimensional array words.counts how many time each word occurs in the article
eg. a word such as 'the' presumably will occur many times in the article. store it once, but count the number of times it occurs. Print bout the stored words and their respective counts
Avatar of nietod
nietod

We cannot do your homework for you.  It is unethical and grounds for removal from this site (for both you and us.)

We can answer specific questions, like you might ask your teacher.
We can review your work and offer suggestions.

So do you have specific questions or would you like to attempt the problem and post what you get done?
what's the problem ? Start counting
Look, nietod's right - but here's a start

assuming you know somthing about whichever language you are programming it in (there are loads of ways to do this) -

   * Open the file
   * Start reading characters one by one
   * Treat spaces as word separators
   * Read each word into a buffer before you store it in the array
   * Check if the word already exists (increment if it does ,or store it if not)
   * When the file ends you have finished

(which is what AnswerTheMan said in two words - 'start counting')

I figure though, that this assignment is not aproblem solving exercise, and is
actually an exercise to teach you the language - so this is not going to be much help.  Let me guess - Exams coming up, assignment due, and you've been getting red-eyes from lack of both attendance and study?
ASKER CERTIFIED SOLUTION
Avatar of MatthewL
MatthewL

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial