Question: in Java. I have done the problem on my own but its not working could you do it so i can see the difference and
in Java. I have done the problem on my own but its not working could you do it so i can see the difference and fix my own
Problem : Files Question. java, Complexity.java, and MiniQuiz.java demonstrate the use of the Complexity interface. Modify the MiniQuiz class
to include a method askQuestion, which takes a question object, asks the user the question, and determines whether the response is correct.
Objective: You are provided with three Java files: Question.java, Complexity.java, and Miniquiz.java. The goal is to modify the MiniQuiz class
by creating an method, which should be called to handle asking the user questions and evaluating their answers.
Steps to Follow:
Step : Open and review the three files Questionjava, Complexity.java, Miniquiz.java
Step : In Miniquiz.java, you will notice that the code for asking and grading each question is almost identical and repeated for two
questions.
Step : Your task is to refactor this code by moving the logic for asking a question into a separate method called in the
class.
Step : Replace the duplicated questionhandling code in the
method with two calls to the new
method.
Step : Ensure that your
method takes a
Question
object as a parameter, asks the question, gets the user's response, and
prints whether the response is correct or not.
Requirements:
The
method must use the
and
methods from the
class.
Make sure the
method is reusable for any Question object.
The complexity level of the question should be printed as well.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
