Write a script that uses a random number generation to create sentences and name it sentences.html. Use five arrays of strings called: uppercase article (uarticle), noun, verb, lowercase article (larticle), and preposition. You will need to use the correct case for the article arrays.
Create a sentence by selecting a word at random from each array in the following order: uarticle, noun, verb, preposition, larticle, noun. You can find examples of generating random numbers in both Fig. 8.6 (dice-rolling) and Fig. 8.7 (random image) of Chapter 8.
The arrays should be filled at minimum, as follows: the article array(s) should contain the articles: the, a, one, some and any. The noun array should contain the nouns: boy, girl, dog, town and car. The verb array should contain the verbs: drove, jumped, ran, walked, and skipped. The preposition array should contain the prepositions: to, from, over, under and on. If you would like to add more words, adjust the arrays appropriately.
As each word is picked, concatenate it to the previous words in the 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 sentences and output them to the screen (document.write or document.writeln). You should use a for loop similarly to the one used in Fig. 8.6 in order to get it to print 20 times.