Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program that formats and prints the above seating arrangement to include

ID: 3685988 • Letter: W

Question





Write a program that formats and prints the above seating arrangement to include a side label and a column header. The application should greet the user with an explanation of the program and then prompt the user to purchase a ticket by either seat or price. Code your application so that a 1 will allow a user to choose by seat and 2 will allow a user to choose by price. Ensure you encorporate input validation. The program should NOT allow any numberbut 1 or 2. See sample run below (NOTE! YOUR OUTPUT MUST BE EXACTLY LIKE THE SAMPLE RUN) SEATS A B CD E F G H I J Row 9 10 10 10 10 10 10 10 10 10 10 Row 8 10 10 10 10 10 10 10 10 10 10 Row 7 10 10 10 10 10 10 10 10 10 10 Row 6 10 10 20 20 20 20 20 20 10 10 Row 5 10 10 20 20 20 20 20 20 10 10 Row 4 10 10 20 20 20 20 20 20 10 10 Row 3 20 20 30 30 40 40 30 30 20 20 Row 2 20 30 30 40 50 5040 30 30 20 Row 1 30 40 50 50 50 50 50 50 40 30 The obove is a birds eye view of all the seating available at Corpus christi Theatre for the Arts. Row 1 is closest to the stage while row 9 represents the back of the theatre. You can either choose a seat by entering the row and seat letter, or you can choose a seat by entering a price Enter 1 to choose by seat or 2 to choose by price:3 That is not a valid number, please enter either 1 or 2: 1 Thank you!

Explanation / Answer

package com.chegg.seatreservation;

import java.util.Scanner;

public class SeatReservation {

   /**
   * @param args
   */
   public static void main(String[] args) {
       // TODO Auto-generated method stub
       Object[ ][ ] seats = new Object[10][11];
      
      
      
       seats[0][1] = "A"; seats[1][0] = "Row 9";
       seats[0][2] = "B"; seats[1][1] = 10;
       seats[0][3] = "C"; seats[1][2] = 10;
       seats[0][4] = "D"; seats[1][3] = 10;
       seats[0][5] = "E"; seats[1][4] = 10;
       seats[0][6] = "F"; seats[1][5] = 10;
       seats[0][7] = "G"; seats[1][6] = 10;
       seats[0][8] = "H";   seats[1][7] = 10;
       seats[0][9] = "I";   seats[1][8] = 10;
       seats[0][10] = "J";   seats[1][9] = 10;
                           seats[1][10] = 10;
      
       seats[2][0] = "Row 8";   seats[3][0] = "Row 7";
       seats[2][1] = 10;       seats[3][1] = 10;
       seats[2][2] = 10;       seats[3][2] = 10;
       seats[2][3] = 10;       seats[3][3] = 10;
       seats[2][4] = 10;       seats[3][4] = 10;
       seats[2][5] = 10;       seats[3][5] = 10;
       seats[2][6] = 10;       seats[3][6] = 10;
       seats[2][7] = 10;       seats[3][7] = 10;
       seats[2][8] = 10;       seats[3][8] = 10;
       seats[2][9] = 10;       seats[3][9] = 10;
       seats[2][10] = 10;       seats[3][10] = 10;
      
      
       seats[4][0] = "Row 6";   seats[5][0] = "Row 5";
       seats[4][1] = 10;       seats[5][1] = 10;
       seats[4][2] = 10;       seats[5][2] = 10;
       seats[4][3] = 20;       seats[5][3] = 20;
       seats[4][4] = 20;       seats[5][4] = 20;
       seats[4][5] = 20;       seats[5][5] = 20;
       seats[4][6] = 20;       seats[5][6] = 20;
       seats[4][7] = 20;       seats[5][7] = 20;
       seats[4][8] = 20;       seats[5][8] = 20;
       seats[4][9] = 10;       seats[5][9] = 10;
       seats[4][10] = 10;       seats[5][10] = 10;
      
       seats[6][0] = "Row 4";   seats[7][0] = "Row 3";
       seats[6][1] = 10;       seats[7][1] = 20;
       seats[6][2] = 10;       seats[7][2] = 20;
       seats[6][3] = 20;       seats[7][3] = 30;
       seats[6][4] = 20;       seats[7][4] = 30;
       seats[6][5] = 20;       seats[7][5] = 40;
       seats[6][6] = 20;       seats[7][6] = 40;
       seats[6][7] = 20;       seats[7][7] = 30;
       seats[6][8] = 20;       seats[7][8] = 30;
       seats[6][9] = 10;       seats[7][9] = 20;
       seats[6][10] = 10;       seats[7][10] = 20;
      
       seats[8][0] = "Row 2";   seats[9][0] = "Row 1";
       seats[8][1] = 20;       seats[9][1] = 30;
       seats[8][2] = 30;       seats[9][2] = 40;
       seats[8][3] = 30;       seats[9][3] = 50;
       seats[8][4] = 40;       seats[9][4] = 50;
       seats[8][5] = 50;       seats[9][5] = 50;
       seats[8][6] = 50;       seats[9][6] = 50;
       seats[8][7] = 40;       seats[9][7] = 50;
       seats[8][8] = 30;       seats[9][8] = 50;
       seats[8][9] = 30;       seats[9][9] = 40;
       seats[8][10] = 20;       seats[9][10] = 30;
      
       for(int i=0;i<10;i++) {
          
           for(int j=0;j<11;j++) {
               if(i==0&&j==0) {
                   System.out.print(" ");
               }else {
                   System.out.print(seats[i][j]+" ");
               }
                  
           }
           System.out.println("");
       }
       System.out.println("");
       System.out.println("The above is a birds eye view of all the seating available at Corpus Christi Theatre for the Arts.Row 1 is");
       System.out.println("closest to the stage while Row 9 represents the back of the theatre.you can either choose a seat by ");
       System.out.println("entering the row and seat letter, or you can choose a seat by entering price.");
      
       System.out.print("Enter 1 to choose by seat or 2 to choose by price : ");
       boolean good = false;
       Scanner scanner = new Scanner(System.in);
       int choice = Integer.parseInt(scanner.next());
       do {
           if(choice==1 || choice==2) {
               good = true;
               System.out.println("Thank you !");
               if(choice==1) {
                   System.out.print("Enter Row : ");
                   int row = Integer.parseInt(scanner.next());
                   System.out.println("");
                   System.out.print("Enter Seat : ");
                   String seat = scanner.next();
                   seats[row][seat] = "XX"; //only this line is not correct for task2 or improvement 2...but the process is correct.i hoe you got some idea.please elaborate your self if possible..or else contact me through my mail id
                  
               }
               break;
           }else{
               System.out.print("This is not valid number, Please enter either 1 or 2 : ");
               choice = Integer.parseInt(scanner.next());
               //System.out.println("Thank you !");
           }
       }while(!good);
      
   }

}

Request : Since it is long question, i had done only task1.If you give some more time i will definitely submit remaining tasks or improvements in the program.so, please consider my request.......this is my email id for contact : kotasunilkumar3@gmail.com..I would be happy if u solve the reamining on your own from now......

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote