Results 1 to 3 of 3
  1. #1
    Bill Nye is offline Member
    Join Date
    May 2012
    Rep Power

    Default My NetBeans wont run/compile my code!

    Java Code:
    import java.util.Scanner;
    public class LunchCounter {
        public static void main (String[] args) {
            //Scanner allows user to enter input.
            Scanner input = new Scanner (;
            //Declaring doubles of Food Packs, paid in BitCoin; and the double
            double total;
            int BitCoinFood1;
            int BitCoinFood2;
            int BitCoinFood3;
            //Printing out statements, and prompting the user for input.
            System.out.println("How many lunches do you request? : ");
            System.out.println("If you don't want any lunches, input 0!");
            //Stating Lunch Item 1 Prices, and using the ints to declare.
            System.out.println("Lunch Item 1 - Price: $5.4 BitCoin");
            BitCoinFood1 = input.nextInt();
            System.out.println("Lunch Item 2 - Price: $6.5 BitCoin");
            BitCoinFood2 = input.nextInt();
            System.out.println("Lunch Item 3 - Price 7.4 BitCoin");
            BitCoinFood3 = input.nextInt();
            //Calculating total + display it for user knowledge.
            total = totalCost(BitCoinFood1, BitCoinFood2, BitCoinFood3);
            System.out.println("The total BitCoin Owed/Due is: " + total);
        //Written method for double totalCost.
        public static double totalCost(int total1, int total2, int total3) {
            //Declaring the double's of the total int and amount funding.
            double total = 0;
            double amount1 = 5.40;
            double amount2 = 6.50;
            double amount3 = 7.40;
            //Equation for calculating the amount of BitCoin owed/due for food.
            total = (amount1*total) + (amount2*total2) + (amount3*total3);
            //Return total;
    What My Decompiler Reports or Does...

    Any help? This is too pass my Java class btw.. Any help would be greatly appreciated. Thanks.
    Last edited by DarrylBurke; 05-04-2012 at 07:09 PM. Reason: Removed annoying text formatting

  2. #2
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    New Zealand
    Rep Power

    Default Re: My NetBeans wont run/compile my code!

    Unless I've missed something, your NetBeans has compiled and is running your program. It appears to be paused, waiting for your input.

    If you have any choice in the matter my advice would be don't use NetBeans: compile and run the program from the command line/terminal/console/"dos" prompt. If you don't or are in a big hurry try clicking in that output panel and entrring something. Also use System.out.println() to print useful diagnostic things like "program starting" at the start and "All done!" at the end.

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Madgaon, Goa, India
    Rep Power

    Default Re: My NetBeans wont run/compile my code!

    Bill Nye has been banned for a year for seeking help with cheating.


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

Similar Threads

  1. Able to compile OK, But wont run..Help
    By subiedude101 in forum New To Java
    Replies: 2
    Last Post: 02-20-2011, 09:37 PM
  2. This one wont compile either.. any tips?
    By Student101 in forum New To Java
    Replies: 9
    Last Post: 11-18-2010, 06:49 AM
  3. Why wont this compile?
    By Student101 in forum New To Java
    Replies: 8
    Last Post: 11-18-2010, 06:33 AM
  4. why wont it compile
    By bje98f in forum Advanced Java
    Replies: 1
    Last Post: 04-23-2009, 10:55 PM
  5. simple problem - code wont compile
    By dirtycash in forum New To Java
    Replies: 1
    Last Post: 11-20-2007, 06:49 PM

Posting Permissions

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