Show the corresponding number

Assignment Help Computer Engineering
Reference no: EM1336135

We are working on hashtables and I am trying to figure out a real life example that could be solved with hashtables to jtree as well as some type of array or jlist. I just need some opinions or examples of this part please.

Here is an exercise I do not understand in this chapter.

Observe the following code, which creates a simple hashtable.
// Demonstrate a Hashtable
import java.util.*;
class HTDemo
{
public static void main(String args[])
{
Hashtable<String,Integer> numbers = new
Hashtable<String,Integer>();

numbers.put("one", new Integer(1));
numbers.put("two", new Integer(2));

}
}

Starting with this provided code, add the following functionality:
1. Add the numbers 3 through 10 to the hashtable continuing in the same manner as shown.
2. Prompt the user for a string, and display the corresponding number. For example, if the user types "five", the program would output "5". This must be done using the hashtable as created in the previous step.
3. Using a loop and a single printlng statement, display all of the values (both strings and integers) in a table.

Reference no: EM1336135

Questions Cloud

Human resources professional to manage a vet assistant : Prepare documentation for a human resources professional to manage a vet assistant and The materials you create would assist human resources professionals to choose, train, and develop successful employees towards helping the company meet its goal..
Explain marketing and what should be the promotional mix : Explain Marketing and What should be the promotional mix AND the advertising mix for Anheiser Busch and many observers concluded that the brewer's days of shelling out huge sums to lock opponents out of key sports deals were coming to a close
Computing cost of the raw material : What is the relevant cost of the 220 kilograms of the raw material when deciding weather to proceed with the special project.
Why do organizations spend money and time training : Why do organizations spend money and time training and retraining employees and Is tuition reimbursement a valid expense?
Show the corresponding number : Using a loop and a single printlng statement, show all of the values (both strings and integers) in a table.
Monopolist can not hire fewer employee and pay a lower wage : A monopolist can not hire fewer employee and pay a lower wage than a firm in a competitive labor market.
How to figure out employee pay : Show the considerations that must be made in evaluate whether an organization should pay employees more than, less than, or equal to the market rate.
Concept of victim precipitation : Why is the concept of victim precipitation so controversial? Do you feel the concept is adequately supported by evidence?
Elucidate the liquidity trap is presently stopping : Elucidate the liquidity trap is presently stopping the Japanese economy from recovering.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Benefit of web-based computing environment

Web-based applications like e-commerce and e-government exemplify the platform shift from the client/server computing to the Web-based computing so for this essay question.

  How an error occurs in the transmission of a block

The cipher block chaining (CBC) mode has the property that it recovers from errors in cipher text blocks. Show that if an error occurs in the transmission of a block , but all the other blocks are transmitted correctly, after that this affects onl..

  Mips single-cycle datapath processor

An instruction is being executed on the MIPS single-cycle datapath processor. Which class of instruction is being executed over the processor? b) Will you specify which instruction is being executing?

  Define the technology guru for interstate trucking company

You are designing an application at work that transmits data record to another building within the same city. The data records are 500 bytes in length, and your application will send one record every 0.5 seconds.

  Performing calculations through class

Build a class known as Rational for carrying out the arithmetic with fractions. Write down a driver program in order to test your class. Addition of the two Rational numbers. Result of addition must be stored in reduced form.

  Create a testrectangle class in java

An overloaded constructor that takes integer width and height arguments, uses a separate method to check whether the width and height fall within the range between 0 and 30, and throws an exception if out of range.

  Consider which properties could be verified

define that some properties that can only be validated originally can be approximately transformed to properties that could be verified.

  Modify compound interest program

Modify compound interest program

  How could pdp augment memory in evaluating

How could PDP augment memory in evaluating the potential risk in this and other potentially threatening situations.

  Problem on encryption using a one-round version of des

Problem on encryption using a one-round version of DES.

  What do you mean by addressable memory capacity

What do you mean by addressable memory capacity.

  Give string that contains more dashes than dots

Write down a seven-character string that contains more dashes than dots and is in the language. Show how you know that your reply is correct.

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