This is what i have to do:
Write a method to accept 10 date objects and store them in the array.
Expand the above method to create a look up table for ‘MONTHS’. ( This will have 12 elements one for each month and should contain a value showing how many times each month appears within the date object array.). Print the contents of the look up table to the screen.
Because the bucket sort looks at integers, i have tried to create a method for the months in my dates so that i could assign each month an iteger value.
e.g. final int January=0; etc
my dates are actually set in my main class and at the moment they look like this:
Date[] a = new Date[ARRAY_SIZE];
a[0]=new Date (2, "January", 2007);
a[1]=new Date (21, "Feburary", 2007); etc.
How do i get my assigned values linked with these dates? I know this example a[0]=new Date.LookUp() (2, "January", 2007); is incorrect but you should see what i am trying by calling up my lookup method which holds the int
2007-12-28
10:00:50
·
2 answers
·
asked by
Anonymous
in
Computers & Internet
➔ Programming & Design