Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Must be in C 1 Write a program that uses random number generation to create sentences. The program should use four arrays of pointers to

Must be in C
image text in transcribed
image text in transcribed
1 Write a program that uses random number generation to create sentences. The program should use four arrays of pointers to char called article,noun, verb and preposition. The program should create a sentence by selecting a word at random from each aray 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 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 aray should contain the articles "the", "a", "one", "some" and any the noun array should contain the nouns "boy", "gir", "dog", "town" and "car" the verb array should contain the verbs "drove", "jumped", "ran", "walked and "skipped", the preposition aray should contain the prepositions "to" "from". "over", "under" and "on" After the preceding program is witten and working, modify the program to produce a short story consisting of several of these sentences. (How about the possibility of a random term paper writer?)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

1. Briefly describe the five components of emotions.

Answered: 1 week ago