Beginning oop java arrayList help | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Beginning oop java arrayList help

I am working on lucky game guess with prizes if the user and the random generator have the same number they will win a prize the problem i have is when the two number matches the prize isn’t printing like I haven’t won anything. I have to store the prizes and there worth in arrayList. And i don’t how.

31st Oct 2022, 8:05 PM
Mohannad
4 Answers
+ 1
Mohannad you can save your code on Sololearn and provide a link here in comment. Then others can review and give more specific advice. Only saying that your code is long, doesn't give too many clues how to help you
1st Nov 2022, 6:05 AM
Tibor Santa
Tibor Santa - avatar
0
Can you store only worthies ? 100, 250, 150
31st Oct 2022, 8:35 PM
zemiak
0
zemiak I already stored prize name and the worth but when the user number and the random number matches print a specific prize i.e. if the user choose 1 and random 1 print prize1 and when 2 print prize2 . Its a bit long code
31st Oct 2022, 9:20 PM
Mohannad
0
when prize 1 was used 0,1,2,3,4 // index a, ,c,d,e // prize what is your plan, shift rest of array left ? 0,1,2,3 // index a,c,d,e // prize
31st Oct 2022, 11:02 PM
zemiak