void administerExam(String examFile) { // readExamItems() is used to retrieve the 1ist of examination items from a file... ExamItem[] items - readExamItems(examFile); int totalPoints - 0, totalScore - 8; for ( #81 item : #02 ) { totalPoints +- item. #03 ; item.display(); item.getAnswerFromUser(); totalScore - item. #04 ; System.out.printf("You got ×d out of xd points.", totalScore, totalPoints); #05 class ExamItem { private int points; public int getItemPoints() { return points; } public 185 void display(); public 185 void getånswerFromUser (); public #85 int checkAnswer (); #06 TrueorFalse extends ExamIten { public void 188 { /* nethod code goes here.. */ } public void 109 { * nethod code goes here.. */ } public int 10 { /* nethod code goes here.. */ } class Multiplechoice #87 ExamItem { public void 108 { /* nethod code goes here.. */ } public void 09 { /* nethod code goes here.. */ } public int #10 { /* nethod code goes here.. */ }

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 #08?

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 4 steps with 1 images

Blurred answer
Knowledge Booster
File Input and Output Operations
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