title: Bus Seat Reservation code amendment in Java
body: <p>I was trying this bus seat reservation code, and found this code somewhere here. I was wondering if you could help me change the result. Instead of 0 the seat entered will be "R". </p>
  
  <p>I'm not familiar to Java.</p>
  
  <pre><code>import java.io.*;
  public class busseatreservation {
  
  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;
      double 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);
      }
  
      for (int l = 0; l &lt; 5; l++) {
          System.out.print("Enter a Seat number to reserve: ");
          ans = Integer.parseInt(br.readLine());
          k = 1;
          for(i=0;i&lt;5;i++) {
              for(j=0;j&lt;7;j++) {
                  if (k == ans) {
                      if (twoDm[i][j]== 0) {
                          System.out.println("That seat has already been reserved");
                      }
                      else {
                           twoDm[i][j]= 0;
                      }
                  }
                  k++;
              }
          }
          for(int[] row : twoDm) {
              printRow(row);
          }
     }
  
  }
  }
  </code></pre>