An examination consists of one or more examination items. Each of the examination items can be of different types (e.g., true or false, multiple choice, enumeration, etc.). All items are associated with the number of points that correspond to the item. Consider the code provided below that includes type declarations for ExamItem, TrueOrFalse, and MultipleChoice, as well as a method administerExam(), that, when invoked, supposedly administers an examination to the user. Complete the given code below. Please answer the question: What must be placed for item/s labeled as #10?

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

An examination consists of one or more examination items. Each of the examination items can be of different types (e.g., true or false, multiple choice, enumeration, etc.). All items are associated with the number of points that correspond to the item. Consider the code provided below that includes type declarations for ExamItem, TrueOrFalse, and MultipleChoice, as well as a method administerExam(), that, when invoked, supposedly administers an examination to the user. Complete the given code below.

Please answer the question: What must be placed for item/s labeled as #10?

void administerExam(String examFile) {
// readExamItems() is used to retrieve the list of examination items from a file...
ExamItem[] items - readExamItems(examFile);
int totalPoints = 0, totalScore = 0;
for (#01 item : #02 ) {
totalPoints += item. #03 ;
item.display();
item.getAnswerFromUser();
totalScore - item. #04 ;
System.out.printf(“You got ×d out of xd points.", totalScore, totalPoints);
#85 class ExamItem {
private int points;
public int getItemPoints() {
return points;
public #05 void display();
public #05 void getânswerFromUser ();
public #05 int checkAnswer ();
#06 TrueorFalse extends ExamItem {
public void #08 { /* method code goes here.. */ }
public void #09 { /* method code goes here.. */ }
public int #10 { /* nethod code goes here.. */ }
class Multiplechoice #87 ExamItem {
public void #08 { /* method code goes here.. */ }
public void #09 { /* method code goes here.. */ }
public int
#10 { /* method code goes here.. */ }
Transcribed Image Text:void administerExam(String examFile) { // readExamItems() is used to retrieve the list of examination items from a file... ExamItem[] items - readExamItems(examFile); int totalPoints = 0, totalScore = 0; for (#01 item : #02 ) { totalPoints += item. #03 ; item.display(); item.getAnswerFromUser(); totalScore - item. #04 ; System.out.printf(“You got ×d out of xd points.", totalScore, totalPoints); #85 class ExamItem { private int points; public int getItemPoints() { return points; public #05 void display(); public #05 void getânswerFromUser (); public #05 int checkAnswer (); #06 TrueorFalse extends ExamItem { public void #08 { /* method code goes here.. */ } public void #09 { /* method code goes here.. */ } public int #10 { /* nethod code goes here.. */ } class Multiplechoice #87 ExamItem { public void #08 { /* method code goes here.. */ } public void #09 { /* method code goes here.. */ } public int #10 { /* method code goes here.. */ }
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
void method
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education