Question: Write a program that declares and initializes 3 arrays of Strings: subjects, verbs and predicates, then creates and prints a silly sentence based on a

Write a program that declares and initializes 3 arrays of Strings: subjects, verbs and predicates, then creates and prints a silly sentence based on a randomly chosen word from each array. It should do this by calling 3 times a method chooseWord that receives an array of Strings and pseudorandomly chooses a word from the array and returns it, e.g. subject = chooseWord(subjects); verb = chooseWord(verbs); predicate = chooseWord(predicate); The silly sentence would be constructed by appending the subject, the verb and the predicate, in that order.

CAN YOU PLEASE WRITE THIS IN JAVA WITH SIMPLE COMMENTS AND BASIC PROGRAM

THANK YOU WILL LEAVE A GOOD RATING

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!