HW7 - Final Program
Your final version of main() is in MadLibs.java.
Your application will:
- Prompt the user to indicate if they wish to administer MadLibs or if they wish to play MadLibs:
- Enter a 1 to Play MadLibs.
- Enter a 2 to Administer MadLibs.
- For either role, your program will prompt for the name of the file with a MadLib story in it,
and continue prompting until the user presses Enter.
For each file, your program will:
- Read in the story.
- Setup the story:
- If the user is a player, you will NOT prompt the user for definitions.
If a definition is missing, you will:
- stop setting up the MadLib.
- print a message indicating that the MadLib cannot be played until the administrator has set it up.
- prompt for the next MadLib file.
- If the player is an administator, you will prompt them for any missing definitions and enter them into the MadDictionary.
Be sure to save the MadDictionary.
- Once the story is properly setup, give the following options to the user:
- Enter a 1 to print the MadLib story to the screen.
- Enter a 2 to print the MadLib story to a PDF file.
If the user is a player, add an option 3:
- Enter a 3 to play the MadLib.
If the user presses Enter (or an invalid option), your program should fall through and take no
action.
After the indicated action is finished from Step 3, prompt the user for the next MadLib file.
Once you are ready to print to PDF:
* Link to download the itext jar
* Documentation:
* A good, short code example is under Section
* Useful classes to look for: