problem with hashes....help!!!

R

rupeshgade

hi All,
i am having some problem with hashes...

Question:i have made a hashmap of "names" and "marks".
now i want to input a name from the keyboard so that it
prints out the marks for that name..how do i do it???something like
getting a value for a key..but from a keyboard input.


Rupesh.
 
A

anno4000

hi All,
i am having some problem with hashes...

Question:i have made a hashmap of "names" and "marks".
now i want to input a name from the keyboard so that it
prints out the marks for that name..how do i do it???something like
getting a value for a key..but from a keyboard input.

So do you know how to do it when the key does not come from a keyboard?
What have you tried? In what way does it fail? Show your work.

Anno
 
J

Jürgen Exner

hi All,
i am having some problem with hashes...

Question:i have made a hashmap of "names" and "marks".
now i want to input a name from the keyboard so that it
prints out the marks for that name..how do i do it???something like
getting a value for a key..but from a keyboard input.

You break down the problem into smaller pieces:
- first you read the input from the keyboard
- then you retrieve the associated value from the hash
- then you print it
(the second and third step can easily be combined)
Which part do you have problems with?

Show us some code and we can probably pinpoint why it doesn't work.

jue
 
R

rupeshgade

HI,
I was having problems with the retriving hash part but now i got it
somehow...Sorry about the code.next time,i post something i will write
the code as well.This group is still new to me so i guess,i will take a
little time to get adjusted.

Rupesh.
 
R

rupeshgade

Hi Anno,
Thnx for the help.i got the answer somehow.next time ,i
will write the code as well..still new to this site..trying to send a
common reply to all but not successful,neways..thnx again.

Rupesh.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,289
Messages
2,571,442
Members
48,125
Latest member
jeremysheoran

Latest Threads

Top