Reference no: EM13940646
Add a class FillInQuestion to the question hierarchy of How To 10.1. An object of this class is constructed with a string that contains the answer, surrounded by _ _, for example, "The inventor of Java was _James Gosling_". The question should be displayed as
The inventor of Java was _____
Here is a sample program run:
_____ was the inventor of Java.
Your answer:
James Gosling
true
The first U.S. president was _____
Your answer:
George Washington
true
Use the following class as your main class:
import java.util.Scanner;
public class QuestionDemo
{
public static void main(String[] args)
{
Question[] quiz = new Question[2];
FillInQuestion question0 = new FillInQuestion(
"_James Gosling_ was the inventor of Java.");
quiz[0] = question0;
FillInQuestion question1 = new FillInQuestion(
"The first U.S. president was _George Washington_");
quiz[1] = question1;
Scanner in = new Scanner(System.in);
for (Question q : quiz)
{
q.display();
System.out.println("Your answer: ");
String response = in.nextLine();
System.out.println(q.checkAnswer(response));
}
}
}
You need to supply the following class in your solution:
FillInQuestion
Which system do you think better protects the defendant
: Should the same system be used for both criminal and civil cases, or would it be better to have one system for criminal matters and the other system for civil matters? Why or why not?
|
Transforming the work environment of nurses
: In no more than 2000 words, write an assignment on: "The USA Agency for Healthcare Research and Quality (2004) produced a document, Keeping patients safe: Transforming the Work Environment of Nurses (2004).
|
What does transparency mean in accounting
: What does "transparency" mean in accounting? What is the term used to describe the possibility that a foreign currency will decrease in US $ value over the life of an asset such as Accounts Receivable
|
Provide a comprehensive idea and scope of the project
: Your task is to complete the project management document to provide a comprehensive idea and scope of the project. Your submission should include the following documents:
|
History of java
: Add a class FillInQuestion to the question hierarchy of How To 10.1. An object of this class is constructed with a string that contains the answer, surrounded by _ _, for example, "The inventor of Java was _James Gosling_". The question should be ..
|
Research in behavioral ethics
: Probably the strongest finding from the last decade research in behavioral ethics is that people simultaneously think of themselves as good people yet frequently lie and cheat (typically in a minor way).
|
Would we have more retribution than rehabilitation
: Prior to the development of a conventional prison system, prisons housed people who were held for a short time because they were unable to pay fines or debts. Others were held for a short time to await trial. Discuss how different our society would..
|
Minimise the chance of something going wrong
: How can the team use project management tools to minimise the chance of something going wrong? This section should be approximately 400 words long plus relevant diagrams.
|
Determine which cost separation methods is being used
: Determine which of the following cost separation methods is being used: the high-low method, the scattergraph method, or the method of least squares.
|