Vcoderz Community

Vcoderz Community (http://forum.vcoderz.com/index.php)
-   Computers & Information Technologies (http://forum.vcoderz.com/forumdisplay.php?f=6)
-   -   Java Please Help ASAP (http://forum.vcoderz.com/showthread.php?t=18160)

7anzala 04-29-2010 12:32 PM

Java Please Help ASAP
 
hey all I have to submit this before midnight and i know nothing about :'( any one can help??????

(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.....:'(

7anzala 04-29-2010 04:48 PM

no one to help?!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Tawa 04-29-2010 05:56 PM

You still have 4 hours dude, good luck :p [Yes I R Rude]

Google 04-30-2010 12:08 AM

The time it took you to write this thread would be enough to finish the code.

7anzala 04-30-2010 06:48 AM

i didnt write it I copy paste ......sa7ee7 inkon zen5een :P
i finished it and submited it ...

Thread Closed :P Admins shufu sheghelkon :P


All times are GMT +1. The time now is 06:57 AM.

Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger