Census

  • 5
  • Locked
  • Exercise
People and other citizens of the universe quite often try to find their relatives. Let's take a step towards a program that can search for people. In this task, we need to create a dictionary (Map), add ten (last name, first name) entries, and then check how many people have the same first name or last name.
You can't complete this task, because you're not signed in.
Comments(14)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
VrhLevel 9 , Zagreb
14 July, 11:59
Damn, lost a lot of time on this assignment... The error was I didn't read the assignment properly so I was putting first name in keys and last name in values.
KIN SOCHEATLevel 19 , Phnom Penh
12 June, 06:38
oh..sorry
KIN SOCHEATLevel 19 , Phnom Penh
12 June, 03:42
/* Comment has been deleted */
RomanLevel 41
12 June, 05:35
Posting the solution in the comments is prohibited.
Keith EmeryLevel 16 , Saint Louis
9 June, 05:25
If you are just starting this exercise, recognize from the beginning that HashMaps must have unique keys. So despite the ambiguity of the instructions, you are not to provide duplicate last names and then try to deal with them in your program.
Jorge SosaLevel 20 , Madrid
5 June, 09:07
I find the instructions misleading. If Map entries can't have duplicate keys, there's no way we can have two people with the same last name (which is acting as the key in this Map).
CapLandLevel 23 , Mentor
6 June, 00:43
Yeah that is very misleading and confusing for students. I guess they want you to try to use the same key and fail because you didn't have 10 pairs in your HasMap. I wonder if it is acceptable for the getSameLastNameCount() method to always return 0?
AISHWARYA ANIL BHOSALELevel 11 , Pune
7 May, 10:49
Hi, I am confused with requirement can some please help me with it.
Sergei PolakovLevel 10 , Donets'k
8 May, 11:24
How are things? decided this task?
AISHWARYA ANIL BHOSALELevel 11 , Pune
15 May, 04:17
no done it yet cannot find a way
Jan kirkLevel 19 , Venkatagiri
3 April, 14:38
Hi I find the expression: "the number of people that have the same first/last name" rather ambiguous. I read it as: "The number of people who share first/last name with minimum 1 other person" Do we mean the same thing ? If yes, then I believe I have solved the task, but it fails on the last 2 conditions in the verification. I checked the computer output of the functions against my manual check, they agree. Please help !
AlexLevel 41
3 April, 15:17
Please use the Help section for questions relating to tasks.
Sergei PolakovLevel 10 , Donets'k
8 May, 11:24
The thing is, I looked at all the clues, and I tried different options.. And even created the theme , maybe I someone will help https://codegym.cc/help/2866 . I watched also on Russian forum similar quests. No solution yet...
Sergei PolakovLevel 10 , Donets'k
8 May, 11:27
rather, there are solutions, and they are fully working... But not verified