I need help on creating a method for my project. What should I do?
import java.util.*; public class JellyBeans { public static void main(String[] args) { // Create a Scanner Scanner input = new Scanner(System.in); // Display a title System.out.println("------------------"); System.out.println("-- Jelly Breans --"); System.out.println("------------------"); // how many people are playing System.out.print("How many players will be making guesses today? "); int playerNum = input.nextInt(); // Create two variables String[] playerName = new String[playerNum]; int[] playerGuess = new int [playerNum]; int jeallyBeans =(int)(Math.random()*(1999-1001+1) + 1001); for (int i =0; i < playerNum; i++) { // input buffer input.nextLine(); // Inputting users name System.out.print("Please enter name #: " + (i+1) + ": "); playerName[i] = input.nextLine(); do { // Enter guess System.out.print(playerName[i] + ", Enter your guess between 1000 and 2000: "); playerGuess[i] = input.nextInt(); } while (playerGuess[i] <= 1000 || playerGuess[i] >=2000); } // calculation int awayFromTheNumber = playerGuess.length- jeallyBeans; // The result System.out.println("There were " + jeallyBeans + " jelly beans in the jar"); for (int i = 0; i < playerGuess.length; i++) { if (playerGuess.length == jeallyBeans); { System.out.println("\nThe winner is " + playerName[i] + "with a guess of " + playerGuess[i] + ", which is exactly the same as the number of jelly beans in the jar."); System.out.println("\nYou were " + + awayFromTheNumber + " of " + jeallyBeans + "jellyBeans"); } else (playerGuess.length > jeallyBeans || playerGuess.length < jeallyBeans); { System.out.println("\n The Winners is + " + playerName[i] + "with a guess of " + playerGuess[i] + " you were away from " + awayFromTheNumber + " jelly beans"); } } // end for } // end main } // end class