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 2 of 2

Thread: Please Help What's Wrong with my Codes!

  1. #1
    Junior Member
    Join Date
    Feb 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post Please Help What's Wrong with my Codes!

    import java.lang.*;
    import java.io.*;
    import javax.swing.*;
     
    public class joy
    {
    public static void main(String[]args)throws IOException
    {
    BufferedReader bb= new BufferedReader(new InputStreamReader(System.in));
     
    String go, fight, win, ha;
    double pls, naman, run, ka;
     
     
    System.out.println("\tA. Student Meal");
    System.out.println("\tB. Employee Meal");
    System.out.println("\tC. Party Order");
    System.out.println("Choice:");
     
    choice(char);
    switch(choice)
    {
     
    case 'A':case 'a':
    int choices1;
    System.out.println("1. Ambula.........35.00p");
    System.out.println("2. Order............45.00p"); System.out.println("3. Group Meal...150.00p"); ha=JOptionPane.showInputDialog(null, "Enter Your Order: "); choices1=Integer.parseInt(ha);
    switch(choices1)
    {
    case 1:
    fight= JOptionPane.showInputDialog(null, "Piece(s) of Order"); namanouble.parseDouble(fight);
    pls=35*naman;
    JOptionPane.showMessageDialog(null,"Total Charge: " +pls);
    win= JOptionPane.showInputDialog(null, "Money Received"); runouble.parseDouble(win);
    ka=run-pls;
    JOptionPane.showMessageDialog(null,"Change: " +ka);
    System.exit(0);
    break;
     
     
    case 2:
    fight= JOptionPane.showInputDialog(null, "Piece(s) of Order"); namanouble.parseDouble(fight);
    pls=45*hah;
    JOptionPane.showMessageDialog(null,"Total Charge: " +pls);
    win= JOptionPane.showInputDialog(null, "Money Received"); runouble.parseDouble(win);
    ka=run-pls;
    JOptionPane.showMessageDialog(null,"Change: " +ka);
    System.exit(0);
    break;
     
     
    case 3:
    fight= JOptionPane.showInputDialog(null, "Piece(s) of Order"); namanouble.parseDouble(fight);
    pls=150*naman;
    JOptionPane.showMessageDialog(null,"Total Charge: " +pls);
    win= JOptionPane.showInputDialog(null, "Money Received"); runouble.parseDouble(win);
    ka=run-pls;
    JOptionPane.showMessageDialog(null,"Change: " +ka);
    System.exit(0);
    break;
    }
    case 'B':case 'b':
    int choices2;
    System.out.println("1. Order.............Php100.00"); System.out.println("2. Group Meal....Php200.00"); ha=JOptionPane.showInputDialog(null, "Enter Your Order: "); choices2=Integer.parseInt(ha);
    switch(choices2)
    {
    case 1:
    fight= JOptionPane.showInputDialog(null, "Piece(s) of Order"); namanouble.parseDouble(fight);
    pls=100*naman;
    JOptionPane.showMessageDialog(null,"Total Charge: " +pls);
    win= JOptionPane.showInputDialog(null, "Money Received"); runouble.parseDouble(win);
    ka=run-pls;
    JOptionPane.showMessageDialog(null,"Change: " +ka);
    System.exit(0);
    break;
     
     
    case 2:
    fight= JOptionPane.showInputDialog(null, "Piece(s) of Order"); hahouble.parseDouble(fight);
    pls=200*naman;
    JOptionPane.showMessageDialog(null,"Total Charge: " +pls);
    win= JOptionPane.showInputDialog(null, "Money Received"); helpouble.parseDouble(win);
    ka=run-pls;
    JOptionPane.showMessageDialog(null,"Change: " +ka);
    System.exit(0);
    break;
    }
     
     
    case 'C':case 'c':
    int choices3;
    System.out.println("1. Buffet.............Php1500.00"); System.out.println("2. Bucket Meal....Php700.00"); ha=JOptionPane.showInputDialog(null, "Enter Your Order: "); choices3=Integer.parseInt(ha);
    switch(choices3)
    {
    case 1:
    fight= JOptionPane.showInputDialog(null, "Piece(s) of Order"); hahouble.parseDouble(fight);
    pls=1500*naman;
    JOptionPane.showMessageDialog(null,"Total Charge: " +pls);
    win= JOptionPane.showInputDialog(null, "Money Received"); helpouble.parseDouble(win);
    ka=run-pls;
    JOptionPane.showMessageDialog(null,"Change: " +ka);
    System.exit(0);
    break;
     
     
    case 2:
    fight= JOptionPane.showInputDialog(null, "Piece(s) of Order"); hahouble.parseDouble(fight);
    pls=700*naman;
    JOptionPane.showMessageDialog(null,"Total Charge: " +pls);
    win= JOptionPane.showInputDialog(null, "Money Received"); helpouble.parseDouble(win);
    ka=run-pls;
    JOptionPane.showMessageDialog(null,"Change: " +ka);
    System.exit(0);
    break;
    }
     
     
    }
    {
    Default:System.out.println("\tInvalid Input");
    System.exit(0);
     
     
    }
     
     
     
    }
    }


  2. #2
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 294 Times in 227 Posts
    Blog Entries
    4

    Default Re: Please Help What's Wrong with my Codes!

    bertzki10, what kind of answer do you expect to get here?

    You have given us no explanation of your problems.
    You need to break this down into one issue at a time and explain clearly the situation and desired output if possible.

    If you follow these rules, you will get helpful answers.
    We are always happy to help but you need to make it as easy for us as possible.

    I am hoping you will learn from this for future posts. Thanks.
    Please use [highlight=Java] code [/highlight] tags when posting your code.
    Forum Tip: Add to peoples reputation by clicking the button on their useful posts.

Similar Threads

  1. WHAT IS WRONG HERE PLEASE?
    By mjava in forum What's Wrong With My Code?
    Replies: 3
    Last Post: August 27th, 2010, 08:29 PM
  2. Something is wrong? Please help.
    By DestinyChick1225 in forum What's Wrong With My Code?
    Replies: 3
    Last Post: April 29th, 2010, 07:47 AM
  3. help with text format codes
    By vanchan09 in forum Java Theory & Questions
    Replies: 1
    Last Post: November 15th, 2009, 04:12 PM
  4. Urgent Help needed with java codes
    By makarov in forum Java Theory & Questions
    Replies: 0
    Last Post: November 13th, 2009, 07:23 AM
  5. help us in eclipse basic codes
    By bil_Imma in forum AWT / Java Swing
    Replies: 1
    Last Post: January 24th, 2009, 06:02 PM