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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

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

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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