Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

java: create a Question class that contains a question and answer variable. Both are String values. Create an askQuestion method that will return a String

java: create a Question class that contains a question and answer variable. Both are String values.

Create an askQuestion method that will return a String that contains the question.

Create a check method that will return true if the given String parameter is equal to the correct answer.

Create a clone method that will be used to create copies of a question and avoid potential issues with shared variables.

Create a Quiz class that contains an array of questions. Create an addQuestion method that will add questions to the quiz. Make sure you use the clone method when adding questions.

Create a Driver class that creates 3 questions and adds them to a quiz. Display the first question then ask the user to input their answer. Use the check method to evaluate the users answer and inform them whether their answer is correct or incorrect.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2018 Dublin Ireland September 10 14 2018 Proceedings Part 1 Lnai 11051

Authors: Michele Berlingerio ,Francesco Bonchi ,Thomas Gartner ,Neil Hurley ,Georgiana Ifrim

1st Edition

3030109240, 978-3030109240

More Books

Students also viewed these Databases questions

Question

Are these written ground rules?

Answered: 1 week ago

Question

Have ground rules been established for the team?

Answered: 1 week ago