Answered step by step
Verified Expert Solution
Question
1 Approved Answer
8.2 (Random Sentences) Write a script that uses random-number generation to com- pose sentences. Use four arrays of strings called article, noun, verb and
8.2 (Random Sentences) Write a script that uses random-number generation to com- pose sentences. Use four arrays of strings called article, noun, verb and preposition. Create a sentence by selecting a word at random from each array in the following order: article, noun, verb, preposition, article and noun. As each word is picked, concate- nate it to the previous words in the sentence. Spaces should separate the words. When the final sentence is output, it should start with a capital letter and end with a period. The script should generate and display 20 sentences.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started