History of java

Assignment Help JAVA Programming
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

Reference no: EM13940646

Questions Cloud

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.

Reviews

Write a Review

JAVA Programming Questions & Answers

  How threads are used to implement currency in java

Describe the concept of concurrency and how threads are used to implement currency in Java

  Describe an application that can deadlock

Describe an application that can deadlock, or starve a thread.

  Leadership position in a hospital emergency room

Identify in a leadership position in a hospital emergency room. Evaluate how  organization handles patient and employee education, and whether that organization participates in any research (if so, find out what types and whether it is mostly qualita..

  What is a nested inner class

What is a nested inner class? What special privileges does a nested inner class have? Give an example of how you declare a nested inner class

  Java application that reads a date in numeric form

Designand write a java application that reads a date in numeric form from a set of three fields and displays it in English within a label. Use appropriate buttons. For Example:

  Generates a random number between 1 and 100

Write a program that generates a random number between 1 and 100 (inclusive) and then prompts the user to guess the number. The user should be given up to 10 chances to guess the number.

  Programming exercises

Modify the rain program in Listing 10.7 so that it does the calculations using pointers instead of subscripts. (You still have to declare and initialize the array.)

  Create the investment calculator

Create the following GUI that allows a user to calculate the value of an investment after a certain number of years with monthly compound interest.

  Discuss factors that affect sorting in sediment

Discuss factors that affect sorting in sediment. How could one tell the latitude at which a sediment was originally deposited? Compare and contrast phosphate and manganese nodules.

  Design a program that extends the definition of the class

Design a program that extends the definition of the class JFrame to display a window on the screen. Name your class PropertyTax1, title your window "Calculation of Property Taxes," set the window's width to 400 pixels and height to 300 pixels, and te..

  Write an array where the user can input 7 temperatures

Write an array where the user can input 7 temperatures; include a 'for' loop. Make sure the temperatures are larger than -100 and smaller than or equal to 120, if not, make sure the user enters a valid number. Make sure the temperature is between the..

  Requests the user to enter a value

Requests the user to enter a value, and searches the array to find a matching value. If there is a match, display Match; otherwise, display No Match.Display only one message at the end of the search.Write the code so the search stops when a match is ..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd