Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.

# Thread: Help with two dimensional array

1. ## Help with two dimensional array

I need hlep with a program that calculates prices for a movie theater based on the seating arrangement at a single movie show. I was able to set the two dimensional array but I am having trouble adding up the movie tickets seatings. There are five different types of tickets. Seat A = 5.50, Seat B = 4.00, Seat C = 6.50, Seat D = 8.50, and Seat E = 5.00. Can anyone help??? The code I have so far is:

public class TheaterSeating {
public static void main(String[] args) {

// Seating Arrangement Array
char[][] seatingArrangement = {
{'A', 'B', 'A', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
{'D', 'B', 'D', 'C', 'C', 'D', 'A', 'E', 'A', 'D'},
{'E', 'D', 'D', 'A', 'C', 'B', 'E', 'E', 'A', 'D'},
{'C', 'B', 'A', 'E', 'D', 'C', 'E', 'E', 'A', 'D'},
{'A', 'B', 'D', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
{'B', 'B', 'E', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
{'B', 'B', 'A', 'C', 'C', 'D', 'E', 'E', 'A', 'D'},
{'E', 'B', 'E', 'C', 'C', 'D', 'E', 'E', 'A', 'D'}};

System.out.print("Theather Seating are as follows: " + "\n");
for (int i=0; i<seatingArrangement.length; i++) {
if(i>=0) System.out.print(seatingArrangement[i]);

if (i>=0) System.out.println(" is the seating arrangement for seat " + i);

}

}
}

• If you want to do this with JavaScript I can help but if you are using Java try the Forum

• yes, I am using JavaScript

•

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•