can you please write this in JAVA without using a scanner In
***can you please write this in JAVA without using a scanner***
Introduction to arrays and Strings
You are going to write a program to perform automated grading for True/False quiz. The first line of input will contain the quiz number followed by the answers to the quiz (T or F). The subsequent lines of input will contain the student\'s name (last, first), the student\'s ID (nine digits), followed by the student\'s answers to the quiz. Your program terminates processing student data when the string \"ZZZZ\" as the only data contained in the input. Your program will output the student\'s ID, the student\'s name (first last) and the score received for the quiz.
An example input to your program:
which will produce the output:
Error processing:
if the answer is neither a T/t or F/f it is considered incorrect.
if no students are in the class, your program will output:
Solution
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
public class Quiz {
public static void main(String[] args) throws IOException
{
BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
String line;
String quizNumber = \"\";
String[] quiz = null;
if ((line = r.readLine()) != null)
{
quiz = line.split(\"\\\\s+\");
quizNumber = quiz[0];
}
int total = 0;
int studentCount = 0;
List<String> studentList = new ArrayList<>();
while(((line = r.readLine()) != null)) {
if (line.equals(\"ZZZZ\"))
{
break;
}
studentCount++;
String[] student = line.split(\"\\\\s+\");
StringBuilder s = new StringBuilder();
s.append(student[2].substring(0,3) + \"-\" + student[2].substring(3,5) + \"-\" + student[2].substring(5,9) + \" \");
s.append(student[1] + \" \" + student[0].substring(0, student[0].length() -1) + \" \");
int score = 0;
for (int i = 1; i < quiz.length; i++)
{
if (quiz[i].toUpperCase().equals(student[i+2].toUpperCase())){
score++;
}
}
s.append(score);
studentList.add(s.toString());
total += score;
}
if (studentList.size() == 0)
{
System.out.println(\"Quiz \" + quizNumber+ \": Empty class data\");
}
else
{
double avg = (double)(total)/studentCount;
System.out.println(\"Results for quiz \" + quizNumber + \":\");
for(String s : studentList)
{
System.out.println(s);
}
System.out.println(\"The average score is \" + avg);
}
}
}

