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

  1 what makes a program easy to modify2 describe the order

1. what makes a program easy to modify?2. describe the order of magnitude of the following code section using bigo

  Length of the string in order to reserve space

To determine the length of the string in order to reserve space for the new string use the library routine strlen. Register a1 contains a pointer to the string to measure and on return register a1 has the number of characters in the string. You..

  Design a java program that has two parallel arrays

Design a java program that has two parallel arrays: a string array named people that is initialized with the names of seven of your friends, and a string array named phoneNumbers that is initialized with your friends phone numbers.

  Complete the design details of the classes in the package

The design phase of the SRS project is in full swing and every developer on the team is assigned a group of packages to work on and to complete the design details of the classes in the package. To help speed up the design process, you-as the softw..

  Explain how to declare and manipulate data in arrays

Please respond to all of the following prompts: Explain how to declare and manipulate data in arrays. Explain the meaning of "array index out of bounds".

  Displays every perfect number from 1 through 1000

Write an application that displays every perfect number from 1 through 1000. A perfect number is one that equals the sum of all the numbers that divide evenly into it.

  A recently formed committee to deal with numerous

Scenario: You are a member of a recently formed committee to deal with numerous complaints against police and correction officers in your town and are asked to determine if there is merit to these allegations and develop a protocol to address the cur..

  Write a program that plots a bar chart for comparing mtbfs

Write a program that plots a bar chart for comparing the MTBFs of different elevator models. The data to be displayed is prepared in a file: Each line consists of the model's letter and the MTBF that has been measured for that file.

  Design implement test and debug a program with a jframe

design implement test and debug a program with a jframe that allows the user to enter a series of contacts names ages

  Write a test application name employeetest

Create two Employee objects and display each objects yearly salary. Then give each employee a 10% raise and display each employee's yearly salary again.

  Create a third string consisting of the first half of string

Show the length of both strings - Create a third string consisting of the first half of string (1) and the second half of string.

  Writing a program that parses

The programming project involves writing a program that parses, using recursive descent, a GUI definition language defined in an input file and generates the GUI that it defines.

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