2023 write a program that administers and grades quizzes A quiz consists of questions There are four types of questions | Assignment Collections

Computer Science 2023 Write A Program That Administers And Grades Quizzes.

2023 write a program that administers and grades quizzes A quiz consists of questions There are four types of questions | Assignment Collections

write a program that administers and grades quizzes. A quiz consists of questions. There are four types of questions: text questions, number questions, choice questions with a single answer, and choice questions with multiple answers. When grading a text question, ignore leading or trailing spaces and letter case. When grading a numeric question, accept a response that is approximately the same as the answer.

A quiz is specified in a text file. Each question starts with a letter indicating the question type (T, N, S, M), followed by a line containing the question text. The next line of a non-choice question contains the answer. Choice questions have a list of choices that is terminated by a blank line. Each choice starts with + (correct) or – (incorrect).

Here is a sample file: 

T Which Java keyword is used to define a subclass? 
extends 

S What is the original name of the Java language? 
– *7 
– C– 
+ Oak 
– Gosling 

M Which of the following types are supertypes of Rectangle? 
– PrintStream 
+ Shape 
+ RectangularShape 
+ Object 
– String 

N What is the square root of 2? 
1.41421356 

Your program should read in a quiz file, prompt the user for responses to all questions, and grade the responses. Follow the design process that was described in this chapter.

Here is a sample program run: 

T Which Java keyword is used to define a subclass? 
input: sub

S What is the original name of the Java language? 
A) *7 
B) C– 
C) Oak 
D) Gosling 

input: C

M Which of the following types are supertypes of Rectangle? 
A) PrintStream 
B) Shape 
C) RectangularShape 
D) Object 
E) String 
Select all that apply:

input: BCD

N What is the square root of 2? 
input: 4

Which Java keyword is used to define a subclass? 

Correct answer: extends 
Your answer: sub 
Your answer was not correct. 

What is the original name of the Java language? 
A) *7 
B) C– 
C) Oak 
D) Gosling 

Correct answer: C 
Your answer: C 
Your answer was correct.

Which of the following types are supertypes of Rectangle? 
A) PrintStream 
B) Shape 
C) RectangularShape 
D) Object 
E) String 

Correct answer: BCD 
Your answer: BCD 
Your answer was correct.

What is the square root of 2? 

Correct answer: 1.41421356 
Your answer: 4 
Your answer was not correct. 

Use the following class as your main class: 

import java.io.FileReader; 
import java.io.IOException; 
import java.util.ArrayList; 
import java.util.Scanner; 

public class QuizRunner { public static void main(String[] args)
throws IOException { Quiz q = new Quiz();
Scanner in = new Scanner(new FileReader(“quiz.txt”));
q.read(in); 
in.close(); 
in = new Scanner(System.in); 
ArrayList questions = q.getQuestions(); 
ArrayList answers = new ArrayList(); 
for (Question qu : questions) 
{ System.out.println(qu.getText()); 
String answer = in.nextLine(); answers.add(answer); } 
boolean[] results = q.checkAnswers(answers); 
for (int i = 0; i < results.length; i++) { System.out.println() ; System.out. println(questions.get(i).getText()); 
System.out.println(“Correct answer: ” + questions.get(i).getAnswer()); System.out.println(“Your answer: ” + answers.get(i)); 
System.out.print(“Your answer was “);
if (!results) { System.out.print(“not “); }
System.out.println(“correct.”);
} } } 

You need to take an OO approach to the code. 

text to be read from file

T
Which Java keyword is used to define a subclass?
extends

S
What is the original name of the Java language?
– *7
– C–
+ Oak
– Gosling

M
Which of the following types are supertypes of Rectangle?
– PrintStream
+ Shape
+ RectangularShape
+ Object
– String

N
What is the square root of 2?
1.41421356

 

 

 

We give our students 100% satisfaction with their assignments, which is one of the most important reasons students prefer us to other helpers. Our professional group and planners have more than ten years of rich experience. The only reason is that we have successfully helped more than 100000 students with their assignments on our inception days. Our expert group has more than 2200 professionals in different topics, and that is not all; we get more than 300 jobs every day more than 90% of the assignment get the conversion for payment.

Place Order Now

#write essay #research paper #blog writing #article writing #academic writer #reflective paper #essay pro #types of essays #write my essay #reflective essay #paper writer #essay writing service #essay writer free #essay helper #write my paper #assignment writer #write my essay for me #write an essay for me #uk essay #thesis writer #dissertation writing services #writing a research paper #academic essay #dissertation help #easy essay #do my essay #paper writing service #buy essay #essay writing help #essay service #dissertation writing #online essay writer #write my paper for me #types of essay writing #essay writing website #write my essay for free #reflective report #type my essay #thesis writing services #write paper for me #research paper writing service #essay paper #professional essay writers #write my essay online #essay help online #write my research paper #dissertation writing help #websites that write papers for you for free #write my essay for me cheap #pay someone to write my paper #pay someone to write my research paper #Essaywriting #Academicwriting #Assignmenthelp #Nursingassignment #Nursinghomework #Psychologyassignment #Physicsassignment #Philosophyassignment #Religionassignment #History #Writing #writingtips #Students #universityassignment #onlinewriting #savvyessaywriters #onlineprowriters #assignmentcollection #excelsiorwriters #writinghub #study #exclusivewritings #myassignmentgeek #expertwriters #art #transcription #grammer #college #highschool #StudentsHelpingStudents #studentshirt #StudentShoe #StudentShoes #studentshoponline #studentshopping #studentshouse #StudentShoutout #studentshowcase2017 #StudentsHub #studentsieuczy #StudentsIn #studentsinberlin #studentsinbusiness #StudentsInDubai #studentsininternational