Menu
support@nursinghomework.org
+1 714-215-3097

(Solved) : Working Project Need Help Code Comments Within Code Explain Methods Keep Getting Find Sym Q35586651

I am working on a project and I need help with my code. All thecomments within my code explain what the methods should do. I keepgetting “Can not find symbol error in my isMarked method and I amnot sure how to fix it. Any help would be appreciated. Thanks!

public class BingoNumber
{
   private int number;
   private boolean [][] mark;
   private int [][] card;
  
   //Constructor constructs an object of typeBingoNumber
   public BingoNumber(int aNumber)
   {
       card = new int [5][5];
       for(int r = 0; r < 5; r++)
       for(int c = 0; c < 5; c++)
      card[r][c]=(int)(Math.random()*75+1);
      
       mark = new boolean [5][5];
       for(int r = 0; r < 5; r++)
       for(int c = 0; c < 5; c++)
       mark[r][c] = false;
      
       number = aNumber;
   }
   //returns the integer representing the number of theBingoNumber.
   public int getNumber()
   {
       return number;
   }
   //returns true or false whether the number ismarked
   public boolean isMarked()
   {
       for(int r = 0; r < mark.length;r++)
       for(int c = 0; c < mark.legnth;c++)
       mark[r-1][c-1] = true;
       return mark[r-1][c-1];
      
   }
   /*returns a two-digit string presentation of aBingoNumber.
   The output string depends on whether the number ismarked.
   If the number is not marked yet, shows thenumber.
   If the number is marked, the output string will XX.**/
   public String toString()
   {  
       StringBuilder s = new StringBuilder();
       s.append(number);
       for(int r = 0; r < 5; r++)
       for(int c = 0; c < 5; c++)
       if(card[r][c] == number)
       s.append(“XX”);
       return s.toString();
   }
   /*Returns a two-digit string representation of aBingoNumber
   as if it has not been marked yet.*/
   public String toNumberString()
   {
       StringBuilder s = new StringBuilder();
       s.append(number);
       return s.toString();
   }
   //Notes that once the number is marked it cannot beunmarked.
   /*Later in a future class there will be method thatwill
   let users unmark a Bingo number.*/
   public void mark()   
   {
       for (int i = 0; i < card.length;i++)
       {
           for(int r = 0; r< 5; r++)
           for(int c = 0; c< 5; c++)
           {
              if(card[r][c]==number)
              mark[r][c] = true;
           }
       }
   }
}

Leave a Reply

Your email address will not be published. Required fields are marked *