Results 1 to 5 of 5
  1. #1
    eclipseGirl is offline Member
    Join Date
    Dec 2012
    Posts
    1
    Rep Power
    0

    Default Help with my java project! :-)

    Hi, im doing a java project and I'm stuck on a certain bit of it Here's what im being asked to do:
    "The program should:
    • Display a seating plan for the theatre showing the seats that are booked and those that are available. For example, consider the following where:
    o A # symbol represents an available seat.
    o A P represents a booked premium seat.
    o An R represents a booked regular seat.
    o An E represents a booked economy seat."

    This is my code so far:
    Scanner keyboard = new Scanner(System.in);
    int premium ;
    int regular;
    int economy;
    int buyticket;
    int ticket;
    int numofticket;
    int cancel;
    int soldpremium = 0;
    int soldregular = 0;
    int soldeconomy = 0;
    int count = 0;

    double premiumPrice = 10;
    double regularPrice = 7.50;
    double economyPrice = 5;




    String menuString;
    String menu1 = "Book Seats";
    String menu2 = "Reports";
    String menu3 = "Cancellations";
    String menu4 = "Exit";


    menuString = ("\t\t\t Rory Gallagher Theatre\n\n" +
    "1." + menu1 + "\n" +
    "2." + menu2 + "\n" +
    "3." + menu3 + "\n" +
    "4." + menu4);
    System.out.println(" " + menuString);


    {
    //display the stage
    System.out.println("\t\tŠ STAGE Š");
    System.out.println("\t'''''''''''''''''''");
    System.out.println("P P P P P P P # # #");
    System.out.println("# # # # # # # # # #");
    System.out.println("R R R R R R R R R R");
    System.out.println("R R R R R # # # # #");
    System.out.println("# # # # # # # # # #");
    System.out.println("# # # # # # # # # #");
    System.out.println("# # # # # # # # # #");
    System.out.println("# # # # # # # # # #");
    System.out.println("E E # # # # # # # #");
    System.out.println("# # # # # # # # # #");

    }




    double choice = keyboard.nextDouble();
    /////while (count < 100)
    //////{
    if (choice ==1)
    {
    System.out.println("What type of seat do you want to buy tickets for?");
    System.out.println("1 - Premium seat (€10.00)");
    System.out.println("2 - Regualar seat (€7.50)");
    System.out.println("3 - Economy seat (€5.00)");
    }
    double choice1 = keyboard.nextDouble();
    if (choice1 ==1)
    {
    System.out.println("You have selected Premium seats for €10.00");
    System.out.println("How many tickets do you want to buy?");
    premium = keyboard.nextInt();
    System.out.println("You have booked " + premium + " tickets, Your total price is: €" + premium*premiumPrice);
    }
    if (choice1 ==2)
    {
    System.out.println("You have selected Regular seats for €7.50");
    System.out.println("How many tickets do you want to buy?");
    regular = keyboard.nextInt();
    System.out.println("You have booked " + regular + " tickets, Your total price is: €" + regular*regularPrice) ;
    }
    if (choice1 ==3)
    {
    System.out.println("You have selected Economy seats for €5.00");
    System.out.println("How many tickets do you want to buy?");
    economy = keyboard.nextInt();
    System.out.println("You have booked " + economy + " tickets, Your total price is: €" + economy*economyPrice) ;
    }


    else if (choice ==2)
    {
    System.out.println(" Sales Summary");
    System.out.println("==============");
    System.out.println("The number of premium tickets sold\n:" + soldpremium);
    System.out.println("The number of regular tickets sold\n:" + soldregular);
    System.out.println("The number of economy tickets sold\n:" + soldeconomy);
    System.out.println(" Sales Bar Chart");
    System.out.println("================");
    System.out.println("Number of premium tickets sold\n:" );
    System.out.println("Number of regular tickets sold\n:" );
    System.out.println("Number of economy tickets sold\n:" );
    System.out.println(" Ticket Availability");
    System.out.println("================");
    System.out.println(" Premium tickets ");
    System.out.println(" Regular tickets ");
    System.out.println(" Economy tickets ");

    System.out.println("Sales Bar Chart");
    System.out.println("==================");
    System.out.println("Number of Premium Tickets Sold:" + "|" * soldpremium);
    System.out.println("Number of Regular Tickets Sold:" + "|" * soldregular);
    System.out.println("Number of Economy Tickets Sold:" + "|" * soldeconomy);

    }
    else if (choice ==3)
    {
    }
    else if (choice ==3)
    {
    System.out.println("What type of ticket do you want to cancel?");
    System.out.println("1 - Premium seat ");
    System.out.println("2 - Regual seat ");
    System.out.println("3 - Economy seat");
    System.out.println("Entre a value between 1 and 3:");
    }
    double choice2 = keyboard.nextDouble();
    if (choice2 == 1 )
    {
    System.out.println("How many tickets would you like to cancel?");
    numofticket = keyboard.nextInt();
    System.out.println("You have canceled " + numofticket + " tickets, will refund (€):" + 10.00*numofticket );
    }
    if (choice2 == 2 )
    {
    System.out.println("How many tickets would you like to cancel?");
    numofticket = keyboard.nextInt();
    System.out.println("You have canceled " + numofticket + " tickets, will refund (€):" + 7.50*numofticket );
    }
    if (choice2 == 3 )
    {
    System.out.println("How many tickets would you like to cancel?");
    numofticket = keyboard.nextInt();
    System.out.println("You have canceled " + numofticket + " tickets, will refund (€):" + 5.00*numofticket );
    }
    }

    ////}


    }

    "

    Please help me, im new to java! :-)

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    4,038
    Rep Power
    10

    Default Re: Help with my java project! :-)

    When posting code, please use the code tags. Unformatted code is pretty impossible to read.

    What does this code do? What is it supposed to do? You've posted your homework and some code, but no explanation of what it does or what you need help with.

    You should consider condensing your problem into an SSCCE that we can copy and paste to run as well as asking a specific technical question.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    Aash96 is offline Member
    Join Date
    Dec 2012
    Posts
    26
    Rep Power
    0

    Default Re: Help with my java project! :-)

    What seems to be the problem?

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,458
    Rep Power
    20

    Default Re: Help with my java project! :-)

    Please go through the Forum Rules, particularly the third paragraph. Also go through Guide For New Members and BB Code List - Java Programming Forum

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  5. #5
    monkeyjr97 is offline Senior Member
    Join Date
    Nov 2012
    Posts
    256
    Rep Power
    3

Similar Threads

  1. Replies: 7
    Last Post: 11-27-2012, 11:16 AM
  2. Creating a project in eclipse from existing project
    By Suraiya in forum New To Java
    Replies: 1
    Last Post: 10-08-2011, 10:14 AM
  3. Java Project
    By KQuick in forum New To Java
    Replies: 7
    Last Post: 03-23-2011, 09:28 AM
  4. JAVA Project
    By kappasig84 in forum New To Java
    Replies: 6
    Last Post: 12-13-2009, 10:28 PM

Tags for this Thread

Posting Permissions

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