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

  Make application that changes the color of the frame

build a frame with four buttons: one for red, one for green, one for blue, and one for gray. Clicking on a button changes the frame to the corresponding color.

  Using access qbe or sql

Using the Access QBE or SQL, produce and run the view-equivalent queries to answer the questions that follow.

  Design c++ program with 4 classes called a,b,c and d

Write down a C++ program with 4 classes called A,B,C and D. D should inherit C, C should inherit B and B should inherit A. All classes should have 1 data member of type int, 1 constructor and 1 function called print.

  Assume the javascript variables greeting

Write down a line of code to replace line 3 above which will create a greeting 'Hello Earthling!' with a space in between 'Hello' and 'Earthling' and an exclamation mark at the end.

  Write down an expression that evaluates to true

Given variables isFullTimeStudent and age , write an expression that evaluates to true if age is less than 19 or isFullTimeStudent is true.

  Take a demand-paging system

Consider a demand-paging system with the following time-measured utilizations.

  Which would create a better product

Which would create a better product

  Breaking the version of cipher

Assume an improved version of Vigen ere cipher in which in place of utilizing several shift ciphers, several mono-alphabetic substitution ciphers are utilized.Display how to break this version of the cipher.

  Calculate the mortgage payments

A program written in Java (without a graphical user interface) that will compute and display the monthly payment amount to fully amortize a $200,000.00 loan over a 30 year term at 5.75? interest.

  Make procedures are followed by database development teams

What is the key reason(s) that make many developers skip over the documentation and proper design procedures? As a manager, how do you ensure that the proper database design procedures are followed by database development teams?

  Would this proposed solution meet the requirements

Your company has just occupied an old historic building in which 15 employees will work. because of historic building codes, the company is not permitted to run cables inside walls or ceilings.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

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