I am working on a theatre seat assignment and i encountered a problem. The follo
ID: 3686053 • Letter: I
Question
I am working on a theatre seat assignment and i encountered a problem.
The following method prints 0 in the place of the price the user chooses, however i want it to print XX in that place.
PLEASE HELP.
public static void sellSeatByNumber(int seatingChart[][])
{
String user;
int col = 0;
System.out.println("Enter row: ");
int row = in.nextInt();
row = Math.abs(row-9);
System.out.print("Enter seat: ");
col = in.nextInt();
col -= 1;
if (seatingChart[row][col]!=0)
{
seatingChart[row][col] = 0;
printSeats(seatingChart);
System.out.println("Your seat has been reserved and reflected with a 0 on the chart now.");
}
else { System.out.println("That seat is already taken, please try again"); }
}
}
Explanation / Answer
For this you have to change in the function printSeats() since this is the function which is actually printing messages on screen.
change in printSeats(seatingChart);
Comment the printSeats() method to know exactly where you have to make the changes
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.