|
|
|||||||
| Computers & Information Technologies « Everything related to computers and internet. » |
![]() |
|
|
Share | Thread Tools | Search this Thread |
|
|
#1 |
|
Registered Member
Last Online: 05-15-2012
Join Date: Sep 2006
Posts: 530
Thanks: 9
Thanked 41 Times in 34 Posts
Groans: 0
Groaned at 1 Time in 1 Post
|
hey all I have to submit this before midnight and i know nothing about
(a) The class UFOSurvey needs a single private instance variable called alienSightings. Write the declaration for this variable considering that: o It should be declared to be of a suitable interface type to hold a map whose keys are integers, and whose values are a set of strings. o More colors may need to be added to any area at any time. An area code is only included when there is color data recorded for that area. The data should be stored in such a way that the area codes are kept in ascending numerical order when new area codes are added. o The colors for each area code need not be kept in any specific order. For any given area code, a given color should never be recorded more than once. hala2 I solved That : private Map<Integer,Set<String>> alienSightings; { } (b) Write a zero-argument constructor that creates an empty instance of a suitable class that implements a map and assigns it to alienSightings. and i solved that kamen: public UFOSurvey() { super(); alienSightings=new TreeMap<Integer,Set<String>>(); } (c) Write an instance method for the UFOSurvey class called addSighting(). The method should take two arguments, one for an area code, and one for a colour. If this is a new area code the method should add an entry to the map for that code with the given colour, otherwise the method should simply add a colour to the existing collection of colours for that area, unless that colour is already in the collection, in which case there should be no change. The message answer should be true if the map has changed, otherwise false. (d) The UFOSurvey class needs a second instance method called findAreasForColour() which takes a string argument and returns a set of all areas with a sighting of that colour. This method should work irrespective of how many entries might subsequently be added to alienSightings. please help me.....
__________________
ALEXANDER Al-Kabeer Gonna rule you all...
|
|
|
|
|
#2 |
|
Registered Member
Last Online: 05-15-2012
Join Date: Sep 2006
Posts: 530
Thanks: 9
Thanked 41 Times in 34 Posts
Groans: 0
Groaned at 1 Time in 1 Post
|
no one to help?!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
__________________
ALEXANDER Al-Kabeer Gonna rule you all...
|
|
|
|
|
#3 |
|
Last Online: 12-20-2021
Join Date: Mar 2006
Posts: 6,245
Thanks: 2,121
Thanked 3,365 Times in 1,740 Posts
Groans: 29
Groaned at 44 Times in 35 Posts
|
You still have 4 hours dude, good luck
[Yes I R Rude]
__________________
What we do in life, echoes in eternity.
|
|
|
|
|
#4 |
|
Last Online: 05-30-2013
Join Date: Jan 2008
Posts: 1,788
Thanks: 10,018
Thanked 1,100 Times in 651 Posts
Groans: 1
Groaned at 6 Times in 6 Posts
|
The time it took you to write this thread would be enough to finish the code.
__________________
|
|
|
|
|
#5 |
|
Registered Member
Last Online: 05-15-2012
Join Date: Sep 2006
Posts: 530
Thanks: 9
Thanked 41 Times in 34 Posts
Groans: 0
Groaned at 1 Time in 1 Post
|
i didnt write it I copy paste ......sa7ee7 inkon zen5een :P
i finished it and submited it ... Thread Closed :P Admins shufu sheghelkon :P
__________________
ALEXANDER Al-Kabeer Gonna rule you all...
|
|
|
![]() |
|
| Tags |
| asap, java |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|