8.11 (Random Sentences) Write a program that uses random-number generation to create sen- should tences. The program use four arrays of pointers to char called article, noun, verb and osition. The program should create a sentence by selecting a word at random from each array in prep- 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 large enough to hold the entire sentence. The words should be separated by spaces. When the final sentence is output, it should start with a capital letter and end with a period. The program should generate 20 such sentences. The arrays should be filled as follows: The article array should contain the articles "the", "a", "one", "some" %3D and "any"; the noun array should contain the nouns "boy", "girl", "dog", "town" and "car"; the should contain the verbs "drove", "jumped", "ran", "walked" and "skipped"; the prep- array verb should contain the prepositions "to", "from", "over", "under" and "on". After the preceding program is written and working, modify it to produce a short story con- Sisting of several of these sentences. (How about the possibility of a random term-paper osition array writer?) lines

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter9: Records (struct)
Section: Chapter Questions
Problem 12SA
icon
Related questions
Question

Write in c programming language . 8.11

8.11
(Random Sentences) Write a program that uses random-number generation to create sen-
should
tences. The program use four arrays of pointers to char called article, noun, verb and
osition. The program should create a sentence by selecting a word at random from each array in
prep-
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 large enough to hold the entire sentence.
The words should be separated by spaces. When the final sentence is output, it should start with a
capital letter and end with a period. The program should generate 20 such sentences. The arrays
should be filled as follows: The article array should contain the articles "the", "a", "one", "some"
%3D
and "any"; the noun array should contain the nouns "boy", "girl", "dog", "town" and "car"; the
should contain the verbs "drove", "jumped", "ran", "walked" and "skipped"; the prep-
array
verb
should contain the prepositions "to", "from", "over", "under" and "on".
After the preceding program is written and working, modify it to produce a short story con-
Sisting of several of these sentences. (How about the possibility of a random term-paper
osition array
writer?)
lines
Transcribed Image Text:8.11 (Random Sentences) Write a program that uses random-number generation to create sen- should tences. The program use four arrays of pointers to char called article, noun, verb and osition. The program should create a sentence by selecting a word at random from each array in prep- 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 large enough to hold the entire sentence. The words should be separated by spaces. When the final sentence is output, it should start with a capital letter and end with a period. The program should generate 20 such sentences. The arrays should be filled as follows: The article array should contain the articles "the", "a", "one", "some" %3D and "any"; the noun array should contain the nouns "boy", "girl", "dog", "town" and "car"; the should contain the verbs "drove", "jumped", "ran", "walked" and "skipped"; the prep- array verb should contain the prepositions "to", "from", "over", "under" and "on". After the preceding program is written and working, modify it to produce a short story con- Sisting of several of these sentences. (How about the possibility of a random term-paper osition array writer?) lines
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Structured English
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning