Page 1 of 1

Random Sentence Generator (50pts) Write a program that uses random number generation to create sentences. The programs.

Posted: Tue Jul 05, 2022 10:33 am
by answerhappygod
Random Sentence Generator 50pts Write A Program That Uses Random Number Generation To Create Sentences The Programs 1
Random Sentence Generator 50pts Write A Program That Uses Random Number Generation To Create Sentences The Programs 1 (50.59 KiB) Viewed 11 times
Random Sentence Generator 50pts Write A Program That Uses Random Number Generation To Create Sentences The Programs 2
Random Sentence Generator 50pts Write A Program That Uses Random Number Generation To Create Sentences The Programs 2 (50.59 KiB) Viewed 11 times
Random Sentence Generator (50pts) Write a program that uses random number generation to create sentences. The programs. should use four arrays of pointers to strings that stores the following parts of a sentence: article, noun, verb and preposition. The program should create a sentence by selecting a word at random from each array in the following order: article, noun, verb, preposition, article, noun As each word is picked, it should be concatenated to the previous words in an array large enough to hold the entire sentence. Each word should be separated by spaces. When the final sentence is output it should start with an uppercase letter and end with a period. Your program should ask the user for the number of sentences to generate and output the result. The arrays of pointers to strings should contain the at least the following data (you can add more if you wish) • Article - "the", "a", "one", "some" "any" • Noun - "boy", "girl", "dog", "town", "car" ● Verb - "drove", "jumped", "ran", "walked", "skipped" Preposition - "to", "from", "over", "under", "on" . Here is a sample output: How many sentences would you like to generate? 3 One car walked under the dog. Any town walked on the boy. One dog ran under one car. Tips: As you see in the sample output, the code should follow the order but the sentences may not always make sense! • Optional: use the toupper function to capitalize the first word in the sentence.