Question
I have a Java program that is not able to read the input from the file: 1. Allows you to search the authors names in
I have a Java program that is not able to read the input from the file:
1. Allows you to search the authors names in the text file below.
2. I then needs to print out a random quote associated with that name searched. So if you searched Donald Knuth it would print a random quote of his.
3. If the name is not found it just prints out a random quote from the input file.
Code
public class Main {
/** * Finds number of lines in a file * @param file * @return number of lines in a file */
//parse file to a dictionary of authors and their quotes static Dictionary
}
}
The text file for the program
Premature optimization is the root of all evil (or at least most of it) in programming.;Donald Knuth
We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil.;Donald Knuth
Lisp has jokingly been called "the most intelligent way to misuse a computer". I think that description is a great compliment because it transmits the full flavor of liberation: it has assisted a number of our most gifted fellow humans in thinking previously impossible thoughts.;Edsger Dijkstra, CACM, 15:10 Keep away from people who try to belittle your ambitions. Small people always do that, but the really great make you feel that you, too, can become great.;Mark Twain
If you tell the truth, you don't have to remember anything.;Mark Twain
Life is what happens to you while you're busy making other plans.;John Lennon Whenever you find yourself on the side of the majority, it is time to pause and reflect.;Mark Twain
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started