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

Thread: Need Help!

  1. #1
    Member
    Join Date
    Sep 2012
    Posts
    31
    My Mood
    Confused
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Need Help!

    Hi I am trying to finish a simple program up and having a few issues with the code and the output. Here is my output!
    Welcome to the Web Host Ordering System

    Please enter the price of the new package: $0

    The average sales for these packages is: $NaN
    Welcome to the Shipping Wizard!


    Enter 0 to end!

    Please enter shipping charges: $5

    The shipping charges total up to $ShippingData@18088c0

    Welcome to the Shipping Wizard!


    Enter 0 to end!

    Please enter shipping charges: $3
    The highest shipping charge inputed was: $ShippingData@fec107

    Welcome to the Shipping Wizard!


    Enter 0 to end!

    Please enter shipping charges: $2
    The lowest shipping charge inputes was: $ShippingData@1617189

    BUILD SUCCESSFUL (total time: 9 seconds)

    And I am attaching my code because it is so big plus it is 3 files.
    Attached Files Attached Files

  2. #2
    Member
    Join Date
    Sep 2012
    Posts
    31
    My Mood
    Confused
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Re: Need Help!

    Ok here is the code!!
        public WebHostOrder14() {
            WebHost webHost;
            double average;
            ShippingData shipping;
            ShippingData highest;
            ShippingData lowest;
     
            System.out.println("\nWelcome to the Web Host Ordering System\n");
     
            average = computeAverageSales();
            System.out.printf("\nThe average sales for these packages is: $" + average);
            if (average >= 200) {
                System.out.println("\nWow! Those sales are awesome!!\n");
            }
     
            shipping = computeShippingCharges();
     
            new ShippingData();
            System.out.println("\nThe shipping charges total up to $" + shipping);
            ///LOOK   You MUST use getters in ShippingData to get values for highest and lowest charges
            System.out.println("The highest shipping charge inputed was: $" + getShippingHighest());
            System.out.println("The lowest shipping charge inputes was: $" + this.computeShippingCharges());
            System.out.println();
        }

  3. #3
    Grand Poobah
    Join Date
    Mar 2011
    Posts
    1,549
    My Mood
    Grumpy
    Thanks
    0
    Thanked 169 Times in 160 Posts

    Default Re: Need Help!

    Do you have a question? You can tell when there is a question because it has that funny symbol at the end of the sentence.
    Improving the world one idiot at a time!