Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Apr 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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);


    }

    }
    }

  • #2
    Senior Coder
    Join Date
    Mar 2005
    Location
    Portsmouth UK
    Posts
    4,522
    Thanks
    3
    Thanked 508 Times in 495 Posts
    If you want to do this with JavaScript I can help but if you are using Java try the Forum

  • #3
    New to the CF scene
    Join Date
    Apr 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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
    •