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.

Page 1 of 2 12 LastLast
Results 1 to 25 of 38

Thread: If Then Statement Question!

  1. #1
    Junior Member
    Join Date
    Oct 2013
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default If Then Statement Question!

    Okay so here is my code. For my project we have to calculate the monthly payment for a mortgage. My professor wants us to set it up so when someone enters a negative number for any of the inputs it still lets you enter the rest of them but at the end, the program outputs a message that says "ALL NUMERICAL NUMBERS MUST BE POSITIVE!". I understand the if-then-else statements but I just don't know how to make the program JUST send out the message and not do the calculations if the number is negative. Someone please help! (Also, I know the if statement I have is incorrect, I'm just trying to use an example of what I was saying previously and that the prgram outputs a message but still doees the calculations.)
    package mortgagecalculation2a;
     
    import java.text.NumberFormat;
    import java.util.Scanner;
     
    /**
     *
     * @author Akira
     */
    public class MortgageCalculation2a {
     
        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) {
     
            Scanner in = new Scanner(System.in);
     
     
            double loanAmount;
            double interestRate;
            double numberYears;
            double months;
            double monthlyPayment;
     
            System.out.print("Enter the loan amount: ");
            loanAmount = Double.parseDouble(in.nextLine());
     
            if (loanAmount < 0) {
                System.out.println("ALL NUMERICAL VALUES MUST BE POSITIVE!");
            }
     
            System.out.print("Enter the rate: ");
            interestRate = Double.parseDouble(in.nextLine());
     
            System.out.print("Enter the number of years: ");
            numberYears = Double.parseDouble(in.nextLine());
     
            interestRate = interestRate / 100 / 12;
     
            months = numberYears * 12;
     
            monthlyPayment = interestRate * loanAmount * (Math.pow(1+interestRate, months))/(Math.pow(1+interestRate, months)-1);
     
     
            NumberFormat defaultFormat = NumberFormat.getCurrencyInstance();
            System.out.println("The monthly payment is: " +defaultFormat.format(monthlyPayment));
     
        }
    }


  2. #2
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,387
    My Mood
    Hungover
    Thanks
    144
    Thanked 628 Times in 538 Posts
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    Junior Member
    Join Date
    Oct 2013
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: If Then Statement Question!

    I already checked out that website before posting, that is why I posted. I didn't really see the help in it. It doesn't say anywhere how to do the question I asked.

    --- Update ---

    How do I make the output say the message without it doing the calculations too. All I want is it to recognize that a input is negative and have the output give the message.

  4. #4
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,387
    My Mood
    Hungover
    Thanks
    144
    Thanked 628 Times in 538 Posts

    Default Re: If Then Statement Question!

    Yes, it does.

    Did you check out the keyword I told you about? What did you try with it?

    In fact, you can do it without that keyword, using only the logic you demonstrated in your original post.

    Programming is about experimenting. You aren't going to find an answer for your specific assignment. You have to think about the concepts and reassemble them to solve the problem at hand.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  5. #5
    Junior Member
    Join Date
    Oct 2013
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: If Then Statement Question!

    It basically told me what I already know....
    It does not for a fact tell me how I can make it so the message only shows up once as the output and doesn't still do the calculation. I know it's all about experiments but when you've been experimenting for about 2 hours you tend to get a little frustrated..

  6. #6
    Forum VIP
    Join Date
    Jul 2010
    Posts
    1,669
    Thanks
    25
    Thanked 327 Times in 304 Posts

    Default Re: If Then Statement Question!

    Given your current design, I believe KevinWorkman was attempting to hint you towards the else statement.
    You have an if block for: "if loanAmount is less than 0". In this block, you have the print statement.
    You then need to have an else block, for what should happen if the loanAmount is not less than 0. You don't another if statement, since the else block assumes the opposite of the if statement.
    **Remember: whatever you put in the else block will NOT execute if the if statement is evaluated to true** (big hint right there)

    BTW, by block I am referring to the lines of code between a set of open and closed curly brackets. So the if block is the code between the open and closed curly brackets immediately after the if statement.
    NOTE TO NEW PEOPLE LOOKING FOR HELP ON FORUM:

    When asking for help, please follow these guidelines to receive better and more prompt help:
    1. Put your code in Java Tags. To do this, put [highlight=java] before your code and [/highlight] after your code.
    2. Give full details of errors and provide us with as much information about the situation as possible.
    3. Give us an example of what the output should look like when done correctly.

    Join the Airline Management Simulation Game to manage your own airline against other users in a virtual recreation of the United States Airline Industry. For more details, visit: http://airlinegame.orgfree.com/

  7. #7
    Junior Member
    Join Date
    Oct 2013
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: If Then Statement Question!

    So I what would I put in the else block? Should I put the monthlyPayment equation so that the calculation will not execute then just do a system.out.println of the message? Also, would I have to repeat this process for interestRate and numberYears?

  8. #8
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,387
    My Mood
    Hungover
    Thanks
    144
    Thanked 628 Times in 538 Posts

    Default Re: If Then Statement Question!

    Quote Originally Posted by MLIAKIRA View Post
    So I what would I put in the else block? Should I put the monthlyPayment equation so that the calculation will not execute then just do a system.out.println of the message? Also, would I have to repeat this process for interestRate and numberYears?
    What have you tried?
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  9. #9
    Junior Member
    Join Date
    Oct 2013
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: If Then Statement Question!

    Well I tried putting the equation in there...all i got was a red bar so that didnt work and I dont know what else to put so I asked, sorry.

  10. #10
    Forum VIP
    Join Date
    Jul 2010
    Posts
    1,669
    Thanks
    25
    Thanked 327 Times in 304 Posts

    Default Re: If Then Statement Question!

    Quote Originally Posted by MLIAKIRA View Post
    So I what would I put in the else block? Should I put the monthlyPayment equation so that the calculation will not execute then just do a system.out.println of the message? Also, would I have to repeat this process for interestRate and numberYears?
    You would put EVERYTHING that you don't want to execute if loanAmount was less than 0. As for the other variables, keep in mind that you can put multiple conditions in an if statement with the use of && (means "and"). So, see if you can rearrange some of your code so that you can check the values of loanAmount, interestRate, and numberYears all in the same if statement.
    NOTE TO NEW PEOPLE LOOKING FOR HELP ON FORUM:

    When asking for help, please follow these guidelines to receive better and more prompt help:
    1. Put your code in Java Tags. To do this, put [highlight=java] before your code and [/highlight] after your code.
    2. Give full details of errors and provide us with as much information about the situation as possible.
    3. Give us an example of what the output should look like when done correctly.

    Join the Airline Management Simulation Game to manage your own airline against other users in a virtual recreation of the United States Airline Industry. For more details, visit: http://airlinegame.orgfree.com/

  11. #11
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,387
    My Mood
    Hungover
    Thanks
    144
    Thanked 628 Times in 538 Posts

    Default Re: If Then Statement Question!

    What red bar?
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  12. #12
    Junior Member
    Join Date
    Oct 2013
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: If Then Statement Question!

    if (loanAmount < 0){
            }    else if (monthlyPayment = interestRate * loanAmount * (Math.pow(1+interestRate, months))/(Math.pow(1+interestRate, months)-1)){
     
             System.out.println("ALL NUMERICAL VALUES MUST BE POSITIVE!");
     
            }

    This is the first thing I tried and there is a red line under the equation and when I hover over it says "incompatible types" and "the assigned value is never used"

  13. #13
    Forum VIP
    Join Date
    Jul 2010
    Posts
    1,669
    Thanks
    25
    Thanked 327 Times in 304 Posts

    Default Re: If Then Statement Question!

    Ok, that is incorrect.
    You have System.out.println("ALL NUMERICAL VALUES MUST BE POSITIVE!"); in your else block, not your if block.
    "if (monthlyPayment = interestRate * loanAmount * (Math.pow(1+interestRate, months))/(Math.pow(1+interestRate, months)-1))"
    Is an if statement, not an if block.

    Consider the following code:
    int someCondition = 0;
     
    System.out.println("Start of program"); // This will always execute
    if(someCondition==0) // if statement for: someCondition equals 0
    {	// start of if block
    	System.out.println("Condition is 0");
    }	// end of if block
    else if(someCondition==1) // else if statement for: somecondition equals 1
    {	// start of if else block
    	System.out.println("Condition is 1");
    }	// end of if else block
    else // else statement. The else block is only entered if all previous if and if else statements are evaluated to false
    {	// start of else block
    	System.out.println("Condition is not 0 or 1");
    }	// end of else block
     
    System.out.println("End of program"); // This will always execute
    If we set someCondition to 0, we get the following output:
    Start of program
    Condition is 0
    End of program
    If we set someCondition to 1, we get this output:
    Start of program
    Condition is 1
    End of program
    And if we set someCondition to anything other than 0 and 1, for example: 2, we get this output:
    Start of program
    Condition is not 0 or 1
    End of program
    NOTE TO NEW PEOPLE LOOKING FOR HELP ON FORUM:

    When asking for help, please follow these guidelines to receive better and more prompt help:
    1. Put your code in Java Tags. To do this, put [highlight=java] before your code and [/highlight] after your code.
    2. Give full details of errors and provide us with as much information about the situation as possible.
    3. Give us an example of what the output should look like when done correctly.

    Join the Airline Management Simulation Game to manage your own airline against other users in a virtual recreation of the United States Airline Industry. For more details, visit: http://airlinegame.orgfree.com/

  14. #14
    Junior Member
    Join Date
    Oct 2013
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: If Then Statement Question!

    Still confused because you said everything you put in the else if block doesn't execute and if loanAmount and the other variables is less than zero I don't want the equation to be executed.

  15. #15
    Forum VIP
    Join Date
    Jul 2010
    Posts
    1,669
    Thanks
    25
    Thanked 327 Times in 304 Posts

    Default Re: If Then Statement Question!

    Ok. For your reasons, you don't need an else if statement or block.
    You have two conditions:
    1. loanAmount is less than 0
    2. loanAmount is not less than 0
    So, you need an if statement, and then just an else (no if after that else).

    Next, consider the difference between an if statement and an if block.
    This is an if statement:
    if(someCondition==0) // the statement is between the parentheses
    This is an if block:
    {
    	System.out.println("Condition is 0"); // the block is between the curly brackets: { and }
    }

    In your code, you had the equation in a statement, not a block.

    Do you understand that much?
    NOTE TO NEW PEOPLE LOOKING FOR HELP ON FORUM:

    When asking for help, please follow these guidelines to receive better and more prompt help:
    1. Put your code in Java Tags. To do this, put [highlight=java] before your code and [/highlight] after your code.
    2. Give full details of errors and provide us with as much information about the situation as possible.
    3. Give us an example of what the output should look like when done correctly.

    Join the Airline Management Simulation Game to manage your own airline against other users in a virtual recreation of the United States Airline Industry. For more details, visit: http://airlinegame.orgfree.com/

  16. #16
    Crazy Cat Lady KevinWorkman's Avatar
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    5,387
    My Mood
    Hungover
    Thanks
    144
    Thanked 628 Times in 538 Posts

    Default Re: If Then Statement Question!

    Take a step back. Write a simple test program that lets you play with if/else statements. Feed in hard-coded booleans, like the example aussiemcgr already posted.
    Useful links: How to Ask Questions the Smart Way | Use Code Tags | Java Tutorials
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  17. #17
    Junior Member
    Join Date
    Oct 2013
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: If Then Statement Question!

    **Remember: whatever you put in the else block will NOT execute if the if statement is evaluated to true** (big hint right there)
    This is an if block:
    {
    System.out.println("Condition is 0"); // the block is between the curly brackets: { and }
    }
     if (loanAmount < 0)
            {
     
                System.out.println(monthlyPayment = interestRate * loanAmount * (Math.pow(1+interestRate, months))/(Math.pow(1+interestRate, months)-1));
            }
            else if (interestRate < 0)
            {
                System.out.println(monthlyPayment = interestRate * loanAmount * (Math.pow(1+interestRate, months))/(Math.pow(1+interestRate, months)-1));
            }
            else if (numberYears < 0)
            {
                System.out.println("ALL NUMERICAL VALUES MUST BE POSITIVE!");         
            }
            else 
            {
                System.out.println(monthlyPayment = interestRate * loanAmount * (Math.pow(1+interestRate, months))/(Math.pow(1+interestRate, months)-1));
            }

    I tried it for if, else if and else.

    rgthdrghdfg.PNG

    Did what you said and the equation still calculated

  18. #18
    Forum VIP
    Join Date
    Jul 2010
    Posts
    1,669
    Thanks
    25
    Thanked 327 Times in 304 Posts

    Default Re: If Then Statement Question!

    Ok, that is a step in the correct direction. However, you want this print statement: System.out.println("ALL NUMERICAL VALUES MUST BE POSITIVE!"); in all the if blocks for a value being less than 0.
    There are two ways to approach this:
    1. Repeat the statement in each block
    2. Combine the if statements into one: if loanAmount<0 OR if interestRate<0 OR if numberYears<0, then print ALL NUMERICAL VALUES MUST BE POSITIVE

    The first approach would look like this:
    if (loanAmount < 0)
    {
    	System.out.println("ALL NUMERICAL VALUES MUST BE POSITIVE!");
    }
    else if (interestRate < 0)
    {
    	System.out.println("ALL NUMERICAL VALUES MUST BE POSITIVE!");
    }
    else if (numberYears < 0)
    {
    	System.out.println("ALL NUMERICAL VALUES MUST BE POSITIVE!");         
    }
    else 
    {
    	System.out.println(monthlyPayment = interestRate * loanAmount * (Math.pow(1+interestRate, months))/(Math.pow(1+interestRate, months)-1));
    }

    The second approach would look like this:
    if (loanAmount < 0 || interestRate < 0 || numberYears < 0)
    {
    	System.out.println("ALL NUMERICAL VALUES MUST BE POSITIVE!");
    }
    else 
    {
    	System.out.println(monthlyPayment = interestRate * loanAmount * (Math.pow(1+interestRate, months))/(Math.pow(1+interestRate, months)-1));
    }
    NOTE TO NEW PEOPLE LOOKING FOR HELP ON FORUM:

    When asking for help, please follow these guidelines to receive better and more prompt help:
    1. Put your code in Java Tags. To do this, put [highlight=java] before your code and [/highlight] after your code.
    2. Give full details of errors and provide us with as much information about the situation as possible.
    3. Give us an example of what the output should look like when done correctly.

    Join the Airline Management Simulation Game to manage your own airline against other users in a virtual recreation of the United States Airline Industry. For more details, visit: http://airlinegame.orgfree.com/

  19. #19
    Junior Member
    Join Date
    Oct 2013
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: If Then Statement Question!

    Okay so I tried option 1 and 2 and it still does the calculation at the end. Also, how would I make it so "The monthly payment is: " not even show up, this is what I was trying to do in the beginning, and just put out the error message just once at the very end where it show the monthly payment, that's what my professors looking for.
    double loanAmount;
            double interestRate;
            double numberYears;
            double months;
            double monthlyPayment;
     
            System.out.print("Enter the loan amount: ");
            loanAmount = Double.parseDouble(in.nextLine());
     
            System.out.print("Enter the rate: ");
            interestRate = Double.parseDouble(in.nextLine());
     
            System.out.print("Enter the number of years: ");
            numberYears = Double.parseDouble(in.nextLine());
     
            months = numberYears * 12;
     
            if (loanAmount < 0)
            {
                System.out.println("ALL NUMERICAL VALUES MUST BE POSITIVE!");
            }
            else if (interestRate < 0)
            {
                System.out.println("ALL NUMERICAL VALUES MUST BE POSITIVE!");
            }
            else if (numberYears < 0)
            {
                System.out.println("ALL NUMERICAL VALUES MUST BE POSITIVE!");
            }
            else 
            {
                System.out.println(monthlyPayment = interestRate * loanAmount * (Math.pow(1+interestRate, months))/(Math.pow(1+interestRate, months)-1));
            }
     
            interestRate = interestRate / 100 / 12;
     
            monthlyPayment = interestRate * loanAmount * (Math.pow(1+interestRate, months))/(Math.pow(1+interestRate, months)-1);
     
     
            NumberFormat defaultFormat = NumberFormat.getCurrencyInstance();
            System.out.println("The monthly payment is: " +defaultFormat.format(monthlyPayment));
    54354354.PNG
    Please look at it, I honestly have no clue what else to do (also, you can't see it but there is a yellow line under the equation saying that the assigned value is never used)

  20. #20
    Forum VIP
    Join Date
    Jul 2010
    Posts
    1,669
    Thanks
    25
    Thanked 327 Times in 304 Posts

    Default Re: If Then Statement Question!

    It does the calculation because you are doing the calculation outside of the else block.
    If you do not want the calculation to occur and you don't want the "The monthly payment is" statement to print, all of this code:
    interestRate = interestRate / 100 / 12;
     
            monthlyPayment = interestRate * loanAmount * (Math.pow(1+interestRate, months))/(Math.pow(1+interestRate, months)-1);
     
     
            NumberFormat defaultFormat = NumberFormat.getCurrencyInstance();
            System.out.println("The monthly payment is: " +defaultFormat.format(monthlyPayment));
    Needs to be placed inside of the else block.
    For reference, the else block I am referring to is this one:
    else 
            {
                System.out.println(monthlyPayment = interestRate * loanAmount * (Math.pow(1+interestRate, months))/(Math.pow(1+interestRate, months)-1));
            }
    NOTE TO NEW PEOPLE LOOKING FOR HELP ON FORUM:

    When asking for help, please follow these guidelines to receive better and more prompt help:
    1. Put your code in Java Tags. To do this, put [highlight=java] before your code and [/highlight] after your code.
    2. Give full details of errors and provide us with as much information about the situation as possible.
    3. Give us an example of what the output should look like when done correctly.

    Join the Airline Management Simulation Game to manage your own airline against other users in a virtual recreation of the United States Airline Industry. For more details, visit: http://airlinegame.orgfree.com/

  21. #21
    Junior Member
    Join Date
    Oct 2013
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: If Then Statement Question!

      if (loanAmount < 0)
            {
                System.out.println("ALL NUMERICAL VALUES MUST BE POSITIVE!");
            }
            else if (interestRate < 0)
            {
                System.out.println("ALL NUMERICAL VALUES MUST BE POSITIVE!");
            }
            else if (numberYears < 0)
            {
                System.out.println("ALL NUMERICAL VALUES MUST BE POSITIVE!");
            }
            else  
            {  
            interestRate = interestRate / 100 / 12;
     
            monthlyPayment = interestRate * loanAmount * (Math.pow(1+interestRate, months))/(Math.pow(1+interestRate, months)-1);
     
            NumberFormat defaultFormat = NumberFormat.getCurrencyInstance();
            System.out.println("The monthly payment is: " +defaultFormat.format(monthlyPayment));
            }

    ewdgfsdgsdg.PNG

    -_-

  22. #22
    Junior Member
    Join Date
    Oct 2013
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: If Then Statement Question!

    That didn't work.

  23. #23
    Forum VIP
    Join Date
    Jul 2010
    Posts
    1,669
    Thanks
    25
    Thanked 327 Times in 304 Posts

    Default Re: If Then Statement Question!

    Can you post your entire code?
    NOTE TO NEW PEOPLE LOOKING FOR HELP ON FORUM:

    When asking for help, please follow these guidelines to receive better and more prompt help:
    1. Put your code in Java Tags. To do this, put [highlight=java] before your code and [/highlight] after your code.
    2. Give full details of errors and provide us with as much information about the situation as possible.
    3. Give us an example of what the output should look like when done correctly.

    Join the Airline Management Simulation Game to manage your own airline against other users in a virtual recreation of the United States Airline Industry. For more details, visit: http://airlinegame.orgfree.com/

  24. #24
    Junior Member
    Join Date
    Oct 2013
    Posts
    25
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: If Then Statement Question!

    package mortgagecalculation2a;
     
    import java.text.NumberFormat;
    import java.util.Scanner;
     
    /**
     *
     * @author Akira
     */
    public class MortgageCalculation2a {
     
        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) {
     
     
            Scanner in = new Scanner(System.in);
     
     
            double loanAmount;
            double interestRate;
            double numberYears;
            double months;
            double monthlyPayment;
     
     
     
            System.out.print("Enter the loan amount: ");
            loanAmount = Double.parseDouble(in.nextLine());
     
            System.out.print("Enter the rate: ");
            interestRate = Double.parseDouble(in.nextLine());
     
            System.out.print("Enter the number of years: ");
            numberYears = Double.parseDouble(in.nextLine());
     
            months = numberYears * 12;
     
          if (loanAmount < 0 || interestRate < 0 || numberYears < 0)
    {
    	System.out.println("ALL NUMERICAL VALUES MUST BE POSITIVE!");
     
    }
    else 
    {
    	interestRate = interestRate / 100 / 12;
     
            monthlyPayment = interestRate * loanAmount * (Math.pow(1+interestRate, months))/(Math.pow(1+interestRate, months)-1);
     
            NumberFormat defaultFormat = NumberFormat.getCurrencyInstance();
            System.out.println("The monthly payment is: " +defaultFormat.format(monthlyPayment));
        System.out.println(monthlyPayment = interestRate * loanAmount * (Math.pow(1+interestRate, months))/(Math.pow(1+interestRate, months)-1));
    }
     
            }
     
     
     
        }

    This is my goal for what it should look like..
    wefdsfgsedfg.PNG

  25. #25
    Forum VIP
    Join Date
    Jul 2010
    Posts
    1,669
    Thanks
    25
    Thanked 327 Times in 304 Posts

    Default Re: If Then Statement Question!

    That code cannot create the output you posted in your picture.
    I suggest you make sure your file is saved and run it again.
    NOTE TO NEW PEOPLE LOOKING FOR HELP ON FORUM:

    When asking for help, please follow these guidelines to receive better and more prompt help:
    1. Put your code in Java Tags. To do this, put [highlight=java] before your code and [/highlight] after your code.
    2. Give full details of errors and provide us with as much information about the situation as possible.
    3. Give us an example of what the output should look like when done correctly.

    Join the Airline Management Simulation Game to manage your own airline against other users in a virtual recreation of the United States Airline Industry. For more details, visit: http://airlinegame.orgfree.com/

Page 1 of 2 12 LastLast

Similar Threads

  1. [SOLVED] A Loop statement and a switch statement issue
    By sternfox in forum Loops & Control Statements
    Replies: 13
    Last Post: March 7th, 2013, 03:19 PM
  2. if statement syntax question
    By lanmonster in forum Java Theory & Questions
    Replies: 2
    Last Post: January 27th, 2013, 02:29 PM
  3. Question about IF Statement
    By Brocco767 in forum What's Wrong With My Code?
    Replies: 5
    Last Post: December 3rd, 2012, 02:21 PM
  4. Question about else statement
    By jean28 in forum Java Theory & Questions
    Replies: 1
    Last Post: September 23rd, 2012, 11:52 PM
  5. [SOLVED] Switch statement question
    By shikh_albelad in forum Loops & Control Statements
    Replies: 5
    Last Post: May 31st, 2009, 05:13 AM