943,532 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 623
  • C++ RSS
May 11th, 2008
0

help with text editing

Expand Post »
Problem 1a: Write a program that generate random text as follows:
the uses chooses a max number of words
it reads in a text file
chooses a random word
it prints the random word
it then finds the next instance of that word in the file
it selects the word following the word it just found
it prints this word
if find reaches the end of the document it starts at the beginning again.
The program will terminate if it loops all the way around and lands on the same place.
The program terminates if it generates the max number of words.

Problem 1b: Try the above but after generating the first two words, it must match
sequences of two words rather than just one.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
rigers is offline Offline
1 posts
since May 2008
May 11th, 2008
0

Re: help with text editing

You posted your homework, now post the code you have written to solve it.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,945 posts
since Aug 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: Have problem using size_t type...
Next Thread in C++ Forum Timeline: What are the results for this?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC