Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8527639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:36:47+00:00 2026-06-11T08:36:47+00:00

Can anyone tell me why I am getting these errors? And if so, how

  • 0

Can anyone tell me why I am getting these errors? And if so, how do i fix them?

Bingo.java:176: ']' expected
private static void makeCard(int[][] card, int[picks])
                                               ^
Bingo.java:176: ')' expected
private static void makeCard(int[][] card, int[picks])
                                                    ^
Bingo.java:176: illegal start of type
private static void makeCard(int[][] card, int[picks])
                                                     ^
Bingo.java:176: <identifier> expected
private static void makeCard(int[][] card, int[picks])
                                                      ^
Bingo.java:177: ';' expected
{
 ^
Bingo.java:178: illegal start of type
    System.out.println("Current Number Picks: \n");
          ^
Bingo.java:178: ';' expected
    System.out.println("Current Number Picks: \n");
              ^
Bingo.java:178: invalid method declaration; return type required
    System.out.println("Current Number Picks: \n");
               ^
Bingo.java:178: illegal start of type
    System.out.println("Current Number Picks: \n");
                       ^
Bingo.java:181: illegal start of type
            for (int i=0; i<count; i++){
            ^
Bingo.java:181: ')' expected
            for (int i=0; i<count; i++){
                      ^
Bingo.java:181: illegal start of type
            for (int i=0; i<count; i++){
                       ^
Bingo.java:181: <identifier> expected
            for (int i=0; i<count; i++){
                        ^
Bingo.java:181: ';' expected
            for (int i=0; i<count; i++){
                         ^
Bingo.java:181: > expected
            for (int i=0; i<count; i++){
                                 ^
Bingo.java:181: '(' expected
            for (int i=0; i<count; i++){
                                    ^
Bingo.java:189: class, interface, or enum expected
private static void announceWin(int winFound, int numPicks)
               ^
Bingo.java:192: class, interface, or enum expected
}
^
Bingo.java:196: class, interface, or enum expected
    for (int i = 0;  i < numPicks;  i++){
                     ^
Bingo.java:196: class, interface, or enum expected
    for (int i = 0;  i < numPicks;  i++){
                                    ^
Bingo.java:198: class, interface, or enum expected
                            return true;}
                                        ^
Bingo.java:202: class, interface, or enum expected
}
^
22 errors

Here is the code:

import java.util.*;
import java.io.*;
import java.util.Arrays;

public class Bingo
{
public static final int ROWS = 5;
public static final int COLS = 5;
public static final int VERTICAL = 1;
public static final int DIAGONAL = 2;
public static final int HORIZONTAL = 3;
public static int winFound;
public static int currPick = 0;
public static int randomPick;
public static int WinFound;

public static void main(String[] args)
{   
int Totcards;
int[][] card = new int[ROWS][COLS];

fillCard (card);
printCard(card);
playGame(card);
printCard(card);

  }

private static void fillCard (int[][] card)
{
//  FileReader fileIn = new FileReader("Bingo.in");
//  Bufferreader in = new Bufferreader(fileIn);

    try {
    Scanner scan = new Scanner(new File("bingo.in"));
      for (int i=0; i<card.length; i++){
               for (int j=0; j<card[0].length; j++){
                card[i][j] = scan.nextInt();
    }
    }
    } catch(FileNotFoundException fnfe) {
      System.out.println(fnfe.getMessage());
    }

}

private static void printCard (int[][] card)
{
    System.out.println("\n\tYOUR BINGO CARD : ");
    System.out.println("\n\tB    I    N    G    O");
    System.out.println("\t----------------------");

    for (int i=0; i<card.length; i++){
          for (int j=0; j<card[0].length; j++){
              System.out.print("\t" + card[i][j]);
              }
    System.out.print("\n");
    }
}

private static void playGame (int[][] card)
{

    int numPicks = 0;       

    while (true)
            {
               markCard (card);   // Generate a random num & zero-it out
       winFound = checkForWin(card);  //  Look for zero sums
       numPicks++;

               if (winFound != 0)
               {
                 announceWin (winFound, numPicks);
                 return;
               }
            }


  }     
private static void markCard (int[][] card)
{
  int randomPick = (int) (Math.random() * 74) + 1;

      for (int j = 0;  j < ROWS;  j++){
        for (int k = 0;  k < COLS;  k++){
            if (card[j][k]==randomPick)
                    card[j][k] = 0;}
    System.out.print(" " + randomPick);
    }
}

private static int checkForWin(int[][] card)
{
  int sum=0;

   for (int i = 0;  i < ROWS;  i++)
       {
        sum = 0;
        for (int j = 0;  j < COLS;  j++)
        sum += card[i][j];

        if (sum == 0)
            return HORIZONTAL;
       }

       for (int j = 0;  j < COLS;  j++)
       {
         sum = 0;
         for (int i = 0;  i < ROWS;  i++)
            sum += card[i][j];

        if (sum == 0)
            return VERTICAL;
       }

       sum = 0;
       for (int i = 0;  i < ROWS;  i++)
            sum += card[i][ROWS-i-1];
       if (sum == 0)
            return DIAGONAL;

       sum = 0;
       for (int i = 0;  i < ROWS;  i++)
          sum += card[i][i];

       if (sum == 0)
            return DIAGONAL;

       return WinFound;
    } 

private static void makeCard(int[][] card, int[picks])
{
    System.out.println("Current Number Picks: \n");
            int count = 100;
            int currPick = 0;
            for (int i=0; i<count; i++){
             currPick = (int)(Math.random() * 74) + 1;
             System.out.print(" " + currPick + "\n");
    picks[i] = currPick;
            System.out.print("i: " + i);
            }
}

private static void announceWin(int winFound, int numPicks)
{
System.out.println("winFound: " + winFound + "numpicks: " + numPicks);
}

private static boolean duplicate (int currPick, int[picks], int numPicks)
{
    for (int i = 0;  i < numPicks;  i++){
                    if (picks[i] == currPick){
                            return true;}
        }
            return false;

}
  }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T08:36:48+00:00Added an answer on June 11, 2026 at 8:36 am

    You’re accepting an int array parameter incorrectly.

    You have int [picks] where it should be int[] picks

        import java.util.*;
    import java.io.*;
    import java.util.Arrays;
    
    public class Bingo
    {
    public static final int ROWS = 5;
    public static final int COLS = 5;
    public static final int VERTICAL = 1;
    public static final int DIAGONAL = 2;
    public static final int HORIZONTAL = 3;
    public static int winFound;
    public static int currPick = 0;
    public static int randomPick;
    public static int WinFound;
    
    public static void main(String[] args)
    {   
    int Totcards;
    int[][] card = new int[ROWS][COLS];
    
    fillCard (card);
    printCard(card);
    playGame(card);
    printCard(card);
    
      }
    
    private static void fillCard (int[][] card)
    {
    //  FileReader fileIn = new FileReader("Bingo.in");
    //  Bufferreader in = new Bufferreader(fileIn);
    
        try {
        Scanner scan = new Scanner(new File("bingo.in"));
          for (int i=0; i<card.length; i++){
                   for (int j=0; j<card[0].length; j++){
                    card[i][j] = scan.nextInt();
        }
        }
        } catch(FileNotFoundException fnfe) {
          System.out.println(fnfe.getMessage());
        }
    
    }
    
    private static void printCard (int[][] card)
    {
        System.out.println("\n\tYOUR BINGO CARD : ");
        System.out.println("\n\tB    I    N    G    O");
        System.out.println("\t----------------------");
    
        for (int i=0; i<card.length; i++){
              for (int j=0; j<card[0].length; j++){
                  System.out.print("\t" + card[i][j]);
                  }
        System.out.print("\n");
        }
    }
    
    private static void playGame (int[][] card)
    {
    
        int numPicks = 0;       
    
        while (true)
                {
                   markCard (card);   // Generate a random num & zero-it out
           winFound = checkForWin(card);  //  Look for zero sums
           numPicks++;
    
                   if (winFound != 0)
                   {
                     announceWin (winFound, numPicks);
                     return;
                   }
                }
    
    
      }     
    private static void markCard (int[][] card)
    {
      int randomPick = (int) (Math.random() * 74) + 1;
    
          for (int j = 0;  j < ROWS;  j++){
            for (int k = 0;  k < COLS;  k++){
                if (card[j][k]==randomPick)
                        card[j][k] = 0;}
        System.out.print(" " + randomPick);
        }
    }
    
    private static int checkForWin(int[][] card)
    {
      int sum=0;
    
       for (int i = 0;  i < ROWS;  i++)
           {
            sum = 0;
            for (int j = 0;  j < COLS;  j++)
            sum += card[i][j];
    
            if (sum == 0)
                return HORIZONTAL;
           }
    
           for (int j = 0;  j < COLS;  j++)
           {
             sum = 0;
             for (int i = 0;  i < ROWS;  i++)
                sum += card[i][j];
    
            if (sum == 0)
                return VERTICAL;
           }
    
           sum = 0;
           for (int i = 0;  i < ROWS;  i++)
                sum += card[i][ROWS-i-1];
           if (sum == 0)
                return DIAGONAL;
    
           sum = 0;
           for (int i = 0;  i < ROWS;  i++)
              sum += card[i][i];
    
           if (sum == 0)
                return DIAGONAL;
    
           return WinFound;
        } 
    
    private static void makeCard(int[][] card, int[] picks)
    {
        System.out.println("Current Number Picks: \n");
                int count = 100;
                int currPick = 0;
                for (int i=0; i<count; i++){
                 currPick = (int)(Math.random() * 74) + 1;
                 System.out.print(" " + currPick + "\n");
        picks[i] = currPick;
                System.out.print("i: " + i);
                }
    }
    
    private static void announceWin(int winFound, int numPicks)
    {
        System.out.println("winFound: " + winFound + "numpicks: " + numPicks);
    }
    
    private static boolean duplicate (int currPick, int[] picks, int numPicks)
    {
        for (int i = 0;  i < numPicks;  i++){
                        if (picks[i] == currPick){
                                return true;}
            }
                return false;
    
    }
    }
    

    Compiles for me

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anyone tell me what is happenning here? I am getting duplicated session ID's
can anyone tell me why these aren't being calculated correctly. I'm trying to add
Can anyone tell me why I am getting error when I am validating even
Can anyone tell me why am I getting this error when running app/console in
Can anyone tell me why this code would not be working? $('body').on('test', function() {
can anyone tell me how to select data by date in MS.ACCESS database using
Can anyone tell me why the following code fails to submit the form into
Can anyone tell me how I can correctly pass my application context to my
Can anyone tell me how to identify a particular background process (i.e., Already running
Can anyone tell why my jQuery script is not loading here <?php wp_enqueue_script(jquery); ?>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.