how would i write the code to get this output?


Play a pick four game?
(enter Y to play pick four, anything else for pick 3)
y
How many chances do you want to buy?
5
Your bets:
[[10, 6, 16, 9], [14, 4, 2, 12], [3, 16, 16, 16], [3, 6, 16, 10], [18, 20, 7, 15]]
The winning numbers were:
[3, 7, 2, 24]
Your net income from playing the lottery: -5 dollars
cicero {~/teaching/Spring2006/cs2/lab1} >java App
Play a pick four game?
(enter Y to play pick four, anything else for pick 3)
N
How many chances do you want to buy?
8
Your bets:
[[1, 25, 11], [2, 15, 23], [16, 5, 12], [19, 23, 14], [19, 23, 12], [10, 23, 15], [23, 22, 24], [17, 9, 12]]
The winning numbers were:
[21, 8, 13]
Your net income from playing the lottery: -8 dollars

Greetings:
I don`t quite understand your question, but from reading your other post (I think you should have posted this in the other post), i think that using an array for the bets wouldn`t be the best answer, why dont you create a class that "hosts" the bets with four variables, in case that the user only choose 3 you can set the other one to null, then you just create as many objects as you need of that class for the bets and use any method you prefer to keep track of them, like a Vector

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.