Hello! I am finishing up my final project for my Intro to Computer Science class that requires me to create a menu method that utilizes other class programs. One of the classes is stressing me out the most and its because I cant figure out a way to return several integers. Would anyone be able to help me come up with the lines of code that allow me to return the "Ball" values of the program as a list?
import java.util.Random; import java.util.*; public class LottoClass { public static int Lottery() { int ball1 = 0; int ball2 = 0; int ball3 = 0; int ball4 = 0; int ball5 = 0; int powerBall = 0; ball1 = (int)(Math.random()*59) + 1; powerBall = (int)(Math.random()*32) + 1; while (ball2 == ball1 || ball2 == ball3 || ball2 == ball4 || ball2 == ball5 || ball3 == ball1 || ball3 == ball4 || ball3 == ball5 || ball4 == ball5 || ball4 == ball1 || ball5 == ball1 ) { ball2 = (int)(Math.random()*59) + 1; ball3 = (int)(Math.random()*59) + 1; ball4 = (int)(Math.random()*59) + 1; ball5 = (int)(Math.random()*59) + 1; } /** return ball1, ball2, ball3, ball4, ball5 */ return; } public static int Powerball() { int powerBall = 0; powerBall = (int)(Math.random()*32) + 1; return (powerBall); } }