Question: Please follow directions and code in Java A sentence is a sequence of words with two possible structures: Name1 and Name2 Verb Object.. Name1 or

Please follow directions and code in Java

A sentence is a sequence of words with two possible structures: Name1 and Name2 Verb Object.. Name1 or Name2
The goal of this HW is to: 1) generate random sentences, and 2) check whether a given sentence is acceptable.
class SentenceGenerator { private String sentence; //keep private here! // add the getter and the setter of

A sentence is a sequence of words with two possible structures: Name1 and Name2 Verb Object.. Name1 or Name2 Verb object. Where Namel and Name2 can be any word from the text file names.txt, Verb can be any verb from verbs.txt, and object is any line from things.txt. Example of acceptable sentences: Amari and Riley will bake 1 suit Riley or Jilali deserve rug. (Note that Jilali ian't in names.txt but because of the connector or, we accept the sentence) Riley and Felix afforded 2 Knee PROTECTION gears. Example of non-acceptable sentences Riley and Jilali deserve rug. (Jilali isn't in names.txt) zane crashed Trumpet. (tuo names must be in the sentence). Riley and Zane crash Trumpet (sentences must end with a dot) Max and max afford iphone. (no duplication of a name is allowed)

Step by Step Solution

3.47 Rating (154 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Based on the information provided in the images it seems youre required to work on a Java program that involves generating and checking the acceptability of sentences according to a specific structure ... View full answer

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 Programming Questions!