subject

Use the Question class from Chapter 7 to define a Quiz class. A quiz can have up to 25 questions (create an array of 25 Question objects within your Quiz class). Define an add method of the Quiz class that adds a question to a quiz. Define a giveQuiz method of the Quiz class to present each question in order to the user, accept an answer, and keep track of the result (whether the answer is correct or incorrect). Define a driver class called QuizTime with a main method that creates a sample quiz with 3 questions (that you create and specify in your program), then presents the quiz to the user and prints the final results. Note you do not need to use the Complexity interface used by the Question class in Chapter 7 for this assignment. An example session in the Console window is given below. Example session
What color was George Washington's white horse?
blue
What's your favorite programming language?
Java
How many moons does the planet Earth have (specify a number)?
1
Correct: 2 Incorrect: 1
// // Question. java Author: Lewis/Loftus // // Represents a question (and its answer). //
public class Question implements Complexity { private String question, answer; private int complexityLevel; // // Constructor: Sets up the question with a default complexity. // public Question(String query, String result) { question = query; answer = result; complexityLevel = 1; } // // Sets the complexity level for this question. // public void setComplexity(int level) { complexityLevel = level; } // // Returns the complexity level for this question. // public int getComplexity() { return complexityLevel; } // // Returns the question. // public String getQuestion() { return question; } // // Returns the answer to this question. // public String getAnswer() { return answer; } // // Returns true if the candidate answer matches the answer. // public boolean answerCorrect(String candidateAnswer) { return answer. equals(candidateAnswer); } // // Returns this question (and its answer) as a string. // public String toString() { return question + "\n" + answer; } }

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 00:40
If you arrive at the same time as another user straight across from you yield if a. they flash your headlights at you b. you can’t see their turn signals c. you’re going street and they’re running d. you’re turning they’re going straight plz
Answers: 1
question
Computers and Technology, 22.06.2019 06:50
Type the correct answer in the box. spell all words correctly. which view of report creation allows you to customize the report before the database program creates it? creating a report in allows you to customize the report before the database program creates it. pl asap
Answers: 1
question
Computers and Technology, 22.06.2019 07:30
By refraining from constructing a building until they are certain that it will not cause harm to the environment, an organization is adhering to the
Answers: 2
question
Computers and Technology, 22.06.2019 19:30
When creating a presentation in libre office impress, where does the editing of slides take place? a. the slides panel b. the center panel c. the tasks panel, under the masters pages tab d. the tasks panel, under the layouts tab
Answers: 1
You know the right answer?
Use the Question class from Chapter 7 to define a Quiz class. A quiz can have up to 25 questions (cr...
Questions
question
Mathematics, 17.07.2020 23:01
question
Mathematics, 17.07.2020 23:01
question
History, 17.07.2020 23:01