Problem

Random SentencesCreate an application that produces random sentences as output. Create fiv...

Random Sentences

Create an application that produces random sentences as output. Create five arrays of strings, one each for nouns, adjectives, verbs, prepositions, and articles. Each array should hold several words of that part of speech. For example, the strArticles array could hold the strings "the" and "a"; the strNouns array could hold "Martian", "baby", "skunk", "computer", and "mosquito"; the strPrepositions array could hold "around", "through", "under", "over", and "by"; and so on.

The application should generate sentences by randomly choosing eight words (randomly generating eight array indices) from these arrays, always constructing sentences by using the parts of speech in the following order: article, adjective, noun, verb, preposition, article, adjective, noun.

For example, a sentence might be “The shiny computer flew over a huge mosquito.” In this example, “The” and “a” were randomly chosen from the articles array, “shiny” and “huge” from the adjectives array, “computer” and “mosquito” from the nouns array, “flew” from the verbs array, and “over” from the prepositions array. Be careful to produce sentences that have the proper spacing, uppercase and lowercase letters, and a period at the end.

Design your form with buttons to display the next sentence, to clear all sentences currently displayed, and to close the application. Display your sentences, one per line, in a list box. Allow enough room to display at least 10 sentences. Figure 1 shows an example of the form using a list box. The figure 1 shows the form with three sentences generated.

Figure 1 Random Sentences form

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT