Question
Please download the file DrivingTest.txt and put it under the /WEB-INF folder of your project. This file contains a number of questions for a driving
Please download the file DrivingTest.txt and put it under the /WEB-INF folder of your project. This file contains a number of questions for a driving test. The format of the file is as follows: Each question occupies five consecutive lines: the first line is the question description, the next three lines are three possible answers, and the last line is a number 1, or 2, or 3, which indicates which answer is the correct answer. The exact number of questions is unknown, but we do know that the questions are separated from one another by an empty line. Create a controller servlet DrivingTestBrowser as follows: In init(), read DrivingTest.txt and store the questions in a List in the application scope. In doGet(), process the request, select the question to be displayed, and pass the question (and additional data if necessary) to a view (i.e. JSP). I have most of the things set up. Im struggling to read the information from a text file into a single array list from file. In my constructor I have set up String description; String answerA; String answerB; String answerC; int correctAnswer; so it needs to read that information from the text file into my array list. List information = new ArrayList(); PLEASE HELP
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