I am having a hard time understanding how to do this question. I know that I'm supposed to store the last 3 numbers in an array and I know how array works but I just don't understand how I'm supposed to store the last 3 numbers into the array since the user can input as many numbers as they want. How should I make the program store any last 3 numbers that the user enters? For example, if the user enters like 20 numbers or something, how should I make the program store the last 3 numbers of that sequence? or what if the user were to enter 10 numbers instead? Any help would be appreciated1
#Last 3 numbers
1 messages · Page 1 of 1 (latest)
<@&987246399047479336> please have a look, thanks.
It's in the hint, you just track the last 3 and shift them.
You can use arraylist or stack for it. It’s not the optimised method but it’ll get the job done
We currently haven't learned about arraylists yet
We are only allowed to use arrays
Alright
I'll try it out
And given it looks like an assignment, you shouldn't "cheat" by using an "easier" data type.
True plus you shouldn’t use any “AI tools” to get the code