Question: write code in java that reads a text file in the format of a) First line contains the Exam topic. b) Second line is the
write code in java that reads a text file in the format of
-
a) First line contains the Exam topic.
-
b) Second line is the minimum percentage of correct answers to pass the exam.
-
c) The rest of the file contains up to 10 sets of questions (it may vary for other exams) in the following structure:
First line of a given question set: The Question itself. Second line of a given question set: The multiple choices separated by the symbol #. Third line of a given question set: the number of the correct answer of this set.
Write code in java which:
-
You are required to read all the questions first and then start the exam. To do so, your program shall create the following arrays to hold all the data read from the text file:
-
a) 1-dimension String array, String[], to hold the questions (10 questions).
-
b) 2-dimension String array, String[][], to hold the multiple choice answers, where the first index of the
array is the question number and the second index is the specific answer (from 5 answers of the
multiple choice).
-
c) A 1-Dimension integer array, int[], containing the numbers of the correct answers.
-
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
