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
Get step-by-step solutions from verified subject matter experts
