Pick a quote by number — then harden the program so a bad number doesn't crash it | Workbook p.9
Create a Java app called famous-quotes. Store 10 of your favorite quotes in a String array. Ask the user to pick a number from 1 to 10 and display the matching quote.
First, run it with a valid number and see it work. Then run it again with a number like 12 and watch it crash. Your job is to wrap the array access in a try/catch so the program shows a friendly message instead of a stack trace.
Bonus: Loop back and let the user pick again until they choose to quit. Another bonus: add an option that picks a random quote.
Workbook 3a, p.9 — Exercise: Famous Quotes