title: Seat Reservation two dimensional array
body: <p>I'm doing a Simple seat reservation which uses to dimensional arrays. The program should asked the user to input a seat number and replaced the <strong>reserved</strong> with 0 also user is not allowed to reserve a previously reserved seat and should displayed "seat taken". I have the two dimensional array table (credits to other stackoverflow members which help me through this) and now i don't have the idea how to change the seat number to 0. Could you guys give me some ideas how to work this out. thanks!  </p>
  
  <p>here is my code:  </p>
  
  <pre><code>package newtable;
  
  import java.io.*;
  
  public class Newtable {
  
      public static void printRow(int[] row) {
          for (int i : row) {
              System.out.print(i);
              System.out.print("\t");
          }
          System.out.println();
      }
  
      public static void main(String[] args) throws Exception {
          BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
          int twoDm[][] = new int[5][7];
          int i, j, k = 1;
          int ans;
  
          for (i = 0; i &lt; 5; i++) {
              for (j = 0; j &lt; 7; j++) {
                  twoDm[i][j] = k;
                  k++;
              }
          }
  
          for (int[] row : twoDm) {
              printRow(row);
          }
          System.out.print("Enter a Seat number to reserve: ");
          ans = Integer.parseInt(br.readLine());
  
      }
  }
  </code></pre>