Please help! I need to create a Java class called Headlines, with the following
ID: 3635153 • Letter: P
Question
Please help!I need to create a Java class called Headlines, with the following elements:
- Three instance variables that are arrays of type String. Each array should hold at least 12 Strings. The three arrays will hold data read from three different files, described below.
- A method that opens three input files (named settings.txt, actions.txt and people.txt – see attachments) and reads their data into the 3 arrays (put actions in the action bag, etc.)
- A method that generates and prints out “headlines” consisting of strings pulled randomly from each of the bags, in the following order: people, actions, settings: in other words, randomly choose one people string, then randomly choose one action string, then randomly choose one settings string, and print them all out as one string.
- A main method that creates a Headlines object, prints out a headline, then prompts the user to see whether or not to continue; the program should continue to run as long as the user chooses to see more, and terminates when the user chooses to quit.
Here are the file addresses:
/Users/ribbit/Desktop/actions.txt
/Users/ribbit/Desktop/people.txt
/Users/ribbit/Desktop/settings.txt
Thank you!!!