subject

Quiz Use the Question class o define a Quiz class. A quiz can be composed of up to 25 questions. Define the add method of the Quiz class to add a question to a quiz. Define the giveQuiz method of the Quiz class to present each question in turn to the user, accept an answer for each one, and keep track of the results. Define a class called QuizTime with a main method that populates a quiz, presents it, and prints the final results. public class Question implements Complexity
{
private String question, answer;
private int complexityLevel;
//
// 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;
}
}
Modify your answer to PP 8.10 so that the complexity level of the questions given in the quiz is taken into account. Overload the giveQuiz method so that it accepts two integer parameters that specify the minimum and maximum complexity levels for the quiz questions and presents only questions in that com- plexity range. Modify the main method to demonstrate this feature.
public interface Complexity
{
public void setComplexity(int complexity);
public int getComplexity();
}

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 02:00
Which demographic challenge is europe currently experiencing? a. an aging and decreasing population b. a baby boomc. an unequal distribution between males and females d. a large group of teenagers moving through the school system(i chose a but i'm unsure)
Answers: 1
question
Computers and Technology, 23.06.2019 20:40
On nba 2k 19, every time i try to join a my park game, it leads ro a website telling my dad that he needs ps plus. i already have ps plus though. how do i fix this?
Answers: 2
question
Computers and Technology, 23.06.2019 22:00
Technician a says engine assemblies can be mounted longitudinally in a chassis. technician b says engine assemblies can be mounted transversely in a chassis. who is correct?
Answers: 2
question
Computers and Technology, 24.06.2019 21:30
Along what line of action can the camera move to follow the movement of actors for screen direction? a. along a 90-degree arcb. along a 120-degree arcc. along a 180-degree arcd. along a 360-degree arc
Answers: 1
You know the right answer?
Quiz Use the Question class o define a Quiz class. A quiz can be composed of up to 25 questions. Def...
Questions
question
Mathematics, 17.10.2020 19:01
question
Social Studies, 17.10.2020 19:01
question
Social Studies, 17.10.2020 19:01
question
Mathematics, 17.10.2020 19:01
Questions on the website: 13722359