Assigned: Tuesday January 28, 2003 Deadline: Thursday February 06, 2003 at MIDNIGHT (extended) PROGRAM 3: --------- Write a C++ program that randomly creates short stories. The first step should be to create sentences. You should use four arrays of pointers to construct your sentences. These arrays should be called: article, noun, verb, and preposition. Assume a sentence is constructed using words from these arrays in the following order: Article, noun, verb, preposition, article, and noun. As each word is picked, it should be concatenated to the previous words in an array which is large enough to hold the entire sentence. You should separate the words with spaces. A sentence should start with a capital letter and end with a period. You may fill the arrays as follows (you may choose other words if you prefer): article noun verb preposition ------ ---- ---- ----------- the boy drove to a girl jumped from one elephant spoke on any dog ran over an water sat under some town walked umbrella swam car skipped milk (1) In the first part of this assignment create sentences randomly and output 30 sentences. (2) Extend the program so that the program produces a short story consisting of several sentences. SUGGESTION(S): -------------- Read the archives at csci1730@listserv.uga.edu for Q&A for this assignment. OTHER REQUIREMENTS: ------------------- * Modularized program * Proper commented code * You must submit at least the following files (i.e., all the files necessary to compile your program): README.txt Story.cpp Makefile To submit the files, you will need to use the submit program. Your files need to be under a common subdirectory called "1730_program3". Execute the below command line while in your homedirectory: submit 1730_program3 cs1730 NOTE: you need to be LOGGED ONTO ajax when you execute the submit command. ---------------------------------------------------------------------------- FAQ ---------------------------------------------------------------------------- Question: How long should the "story" part be? Answer: At least 5 sentences. ---------------------------------------------------------------------------- Question: Should our short stories (part 2) word wrap or try to fill a certain number of words/characters per line, or is it alright to print one sentence per line? Answer: One sentence per line is fine. ---------------------------------------------------------------------------- Question: For the random 30 sentences, should it create 30 different sentences everytime you execute the program, or can sentence 1 be the same everytime you run the program. Answer: The first sentence should differ each time you run the program. ---------------------------------------------------------------------------- Question: Does my story need to make any point. Answer: Not necessarily, as long as it is less random than producing random sentences. The goal of the second program is to produce sentences that are "somewhat" related. A first step in creating a story may be, is to write one using the pen and pencil method then analyzing it to see how the sentences relate. In the second step, your approach can either narrow the scope of words that can be selected for "new" sentences "or" add words new that include more details of the "subject" (the noun) of already selected sentences. For example: After you select perhaps "dog" as the the subject of your first sentence, it may allow you to select from "terrier" or "poodle" for the next set of nouns, or perhaps you would add the new verbs such as "docile", and "friendly". Try to be creative, while not making it too complicated.