Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 5 of 5

Thread: HAI. CAN ANYONE HELP ME WITH THIS TICKET SYSTEM PLEASE?

  1. #1
    Junior Member
    Join Date
    Mar 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post HAI. CAN ANYONE HELP ME WITH THIS TICKET SYSTEM PLEASE?

    import javax.swing.*;
    class final1
    {
    public static void main(String[]args)
    {
    //
    String[]TARIKHPERJALANAN=new String[10];
    String[]MASAPERJALANAN=new String[10];
    String[]KATEGORI=new String [10];
    String[]BUS=new String[10];
    int[]TEMPATDUDUK1=new int[10];
    Double[]HARGATIKET1=new Double[10];



    int i,j,BILANGAN1;
    String BILANGAN,TEMPATDUDUK,HARGATIKET,KUANTANKL,KLKUANTA N;


    System.out.println("______________________________ __________________________");
    System.out.println("\n");
    System.out.println("\t\tBULAN RESTU SDN BHD");
    System.out.println("\n");
    System.out.println("BIL\tPERJALANAN\tTARIKH\tMASA\ tKATEGORI\t HARGA TIKET");
    System.out.println("---\t---------\t------\t----\t--------\t -----------");


    for(i=0;i<2;i++)
    {

    BUS[i]=JOptionPane.showInputDialog(null,"PERJALANAN BUS=");
    TARIKHPERJALANAN[i]=JOptionPane.showInputDialog(null,"TARIKH PERJALANAN");
    MASAPERJALANAN[i]=JOptionPane.showInputDialog(null,"MASA PERJALANAN");
    KATEGORI[i]=JOptionPane.showInputDialog(null,"KATEGORI");
    HARGATIKET=JOptionPane.showInputDialog(null,"HARGA TIKET");
    HARGATIKET1[i]=Double.parseDouble(HARGATIKET);


    System.out.print((i+1) +".");
    System.out.print("\t" +BUS[i]);
    System.out.print("\t" +TARIKHPERJALANAN[i]);
    System.out.print("\t" +MASAPERJALANAN[i]);
    System.out.print("\t" +KATEGORI[i]);
    System.out.print("\t\t" +HARGATIKET1[i]+"\n");

    }

    BILANGAN=JOptionPane.showInputDialog(null,"BILANGA N TIKET");
    BILANGAN1=Integer.parseInt(BILANGAN);

    for(j=0;j<=BILANGAN1;j++)

    {

    System.out.println("______________________________ __________________________");
    System.out.println("\n");
    System.out.println("\t\tBULAN RESTU SDN BHD");
    System.out.println("\n");
    System.out.println("\t\t "+BUS[j]);
    System.out.println("\n");
    System.out.println("Tarikh Perjalanan= " +TARIKHPERJALANAN[j]+"\n");
    System.out.println("Masa Perjalanan= " +MASAPERJALANAN[j]+"\n");
    System.out.println("Kategori= " +KATEGORI[j]+"\n");
    System.out.println("Tempat Duduk= "+(j+1)+ "."+"\n");
    System.out.println("Harga Tiket= RM"+ HARGATIKET1[j]);

    }


    }
    }


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,320
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: HAI. CAN ANYONE HELP ME WITH THIS TICKET SYSTEM PLEASE?

    Thread moved from Members Introductions.

    Do you have a question? Please read Announcements - What's Wrong With My Code? , and please wrap your code in the code tags.

  3. #3
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,520
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: HAI. CAN ANYONE HELP ME WITH THIS TICKET SYSTEM PLEASE?

    Welcome to the forum!

  4. #4
    Junior Member
    Join Date
    Mar 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: HAI. CAN ANYONE HELP ME WITH THIS TICKET SYSTEM PLEASE?

    help me please. i cannot search back the data that i save in array. why?

  5. #5
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,520
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: HAI. CAN ANYONE HELP ME WITH THIS TICKET SYSTEM PLEASE?

    If you're searching for a match to a String object, be sure to use the equals() method rather than '=='. Other than that, I have no idea what you're asking. Please show you code that isn't working as you'd like with specific questions about it.

Similar Threads

  1. java code to create ticket
    By prabhat11 in forum Algorithms & Recursion
    Replies: 8
    Last Post: April 19th, 2013, 12:04 PM
  2. Parking Ticket Simulator Help (Almost done, few errors)
    By TitanVex in forum Object Oriented Programming
    Replies: 7
    Last Post: December 5th, 2011, 05:06 PM
  3. lotto ticket generator help
    By tlckl3m3elmo in forum What's Wrong With My Code?
    Replies: 19
    Last Post: July 15th, 2011, 12:39 AM