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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

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

Post 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 10 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 10 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.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply