How do you output the odd numbers here without the 0's?

How do you output the odd numbers here without the 0's?


Personally I would rewrite this entirely to print odd numbers without the array, but it is needed in the future for a counter application.

Yes, this is for school. No, this is not homework, I'm trying to understand the incomplete lesson and get it to work on my own.

Attached: nigger_code.png (1280x800, 154K)

Other urls found in this thread:

github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition/blob/master/src/main/java/com/seriouscompany/business/java/fizzbuzz/packagenamingpackage/impl/math/arithmetics/NumberIsMultipleOfAnotherNumberVerifier.java
twitter.com/NSFWRedditGif

Attached: how i remove zero.png (1530x1298, 348K)

lmao I knew someone would do this to me. It's not my code, it's my professor's. He just left us at something like this, and said, "if you want extra credit, make it work with odd numbers"

For real though, how i remove zero

>It's not my code, it's my professor's.
>extra credit for writing an if statement
jesus fucking christ transfer out of your university immediately
actually, given that you can't figure this out on your own, stay right where you are.

>It's not my code, it's my professor's.

Attached: 1514164746058.jpg (480x480, 23K)

If its the odd or even option just create a smaller array. A list of even numbers till 20 is about half or the size of all the numbers.

this is some retard shit.

OP, in case you're serious, just declare your array but don't initialize it within the toCount() method until you've determined what the mode is.
int[] numbers;
for(...)
if(mode is even or mode is odd)
numbers = new int[10];
if(mode is all)
numbers = new int[20];

you fucking retard.

First of all you should use the Abstract Factory pattern. After you rewrite your code we can talk.

lmaooooo!!!

jesus christ

what
you're a fucking brainlet
how does this solve anything
that's not the problem

>Abstract Factory pattern

He needs to rewrite it using ML functions instead of code 1.0

flawless argument, thanks

Yeah this does not work

int[] numbers;
for(... i < numbers.length; ...) // error
...
return numbers; // error


It gives an error, underlining numbers, saying
>The local variable numbers may not have been initialized
I'm thinking it's because the for loop asks for the length of 'numbers', but the length has not been initialized beforehand.

>Yeah this does not work
no shit, faggot. you need to refactor your code based around the new idea. do you seriously have some sort of learning disability? jesus christ.

Damn, you're a pretty low person. You talk to people like that in real life? And you have friends?

Whatever, man. I'm just gonna do it some other time.

I gotchu senpai

github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition/blob/master/src/main/java/com/seriouscompany/business/java/fizzbuzz/packagenamingpackage/impl/math/arithmetics/NumberIsMultipleOfAnotherNumberVerifier.java

This might look like overkill to some, but if you write commercial level software, it will save you weeks of development, testing and most importantly debugging.

kill yourself, unironically

quaternions

because you made the array size to be fixed 20 then looping through each element to fill. You need to change the formula of how to fill in the array instead of using the original element to calculate what to fill