#Bird Watcher in Java

28 messages · Page 1 of 1 (latest)

unborn lodge
#

Hello, i'm a beginner in Java, is this supposed to be a beginner exercise? Because can't really understand how should i start in the editor.

latent spindle
#

Did you implement task1?

#

What is the part you are struggling with?

unborn lodge
#

task1 it says to get last week numbers

#

i assume it's an array stored somewhere

#

the exercise itself gives me the numbers, but am i supposed to store them inside the getLastWeek function?

#

and return them

latent spindle
#

yep, you can certainly do that.

#

last week always has those numbers

#

so you can either generate them inside the function, or outside (right below the birdsPerDay array for instance)

unborn lodge
#

by generate what do u mean?

latent spindle
#

just type them manually

#

the exercise is about arrays so that's what you should be returning from this function

unborn lodge
#
        int[] lastWeekBirds = {0, 2, 5, 3, 7, 8, 4};
        return lastWeekBirds;
        //throw new UnsupportedOperationException("Please implement the BirdCount.getLastWeek() method");
    }```
latent spindle
#

press the "run tests" button to see if the relevant tests pass

unborn lodge
#

i don't understand if i should think of this exercise as a single big program or if these functions are kinda apart from each other

#

it feels kinda weird

latent spindle
#

in general it's a single program, you are free to use one function inside another

#

but each task will often correspond to a single function

unborn lodge
#

i see now

unborn lodge
#

i solved it now

#

thanks for the support

latent spindle
#

you are welcome. Now, on to the next one 🙂 Cheers.

unborn lodge
#

what do you think of these bundles?

#
Humble Bundle

We’ve teamed up with O’Reilly for our newest bundle. Get books on Rust, TypeScript, SQL, C, C#, C++, and more programming languages. Pay what you want & support charity!

somber scarab
#

I bought both of those bundles because I'm a biblioholic. But will I read them all? Probably not. Good stuff in them, though.

unborn lodge
#

yeah, too bad the beginner stuff isn't in the 1$ tier