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
Grayson Carter
>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.
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.
Caleb Hall
this is some retard shit.
Jason Harris
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.
Ian Perez
First of all you should use the Abstract Factory pattern. After you rewrite your code we can talk.
Grayson Fisher
lmaooooo!!!
Jaxson Sullivan
jesus christ
William Baker
what you're a fucking brainlet how does this solve anything that's not the problem
Charles Wilson
>Abstract Factory pattern
He needs to rewrite it using ML functions instead of code 1.0
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.
Angel Mitchell
>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.
Justin Reyes
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.
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.
Julian Thomas
kill yourself, unironically
Colton Butler
quaternions
Benjamin Diaz
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