Search:

Type: Posts; User: Norm

Search: Search took 0.10 seconds.

  1. Replies
    35
    Views
    2,332

    Re: Programming Exercise Help

    Do you know how to write a small program for testing a statement?
  2. Replies
    35
    Views
    2,332

    Re: Programming Exercise Help

    What did you mean in post#29? "round down to 0"

    Do some experimenting with casting double values to int to see what happens. Write a short test program with this statement. Compile and execute...
  3. Replies
    35
    Views
    2,332

    Re: Programming Exercise Help

    I don't understand your last post. What does "suppose to see" mean?

    Do you know what is causing interest to be zero?
    Do you know how to change the code to keep interest from being zero?
  4. Replies
    35
    Views
    2,332

    Re: Programming Exercise Help

    0.004 is a double and doesn't need to be cast to double.
  5. Replies
    35
    Views
    2,332

    Re: Programming Exercise Help

    What happens to 0.004 when it is converted to an int?
  6. Replies
    35
    Views
    2,332

    Re: Programming Exercise Help

    Look at the code that assigns a value to the variable: interest
    What happens to the value: (annualInterest/12) before it is assigned to interest?
  7. Replies
    35
    Views
    2,332

    Re: Programming Exercise Help

    I'm not asking for an equation. I'm asking for real numbers like: 3 or 4.55 or 0.444444

    The objective is to get a good value assigned to the variable: interest
    What value do you expect to be...
  8. Replies
    35
    Views
    2,332

    Re: Programming Exercise Help

    Why can't you answer the simple question: given annualInterest of 0.05 what value do you want assigned to the variable: interest?

    When you have that value, then look at the code to see why that...
  9. Replies
    35
    Views
    2,332

    Re: Programming Exercise Help

    That's a value for annualInterest. Now what is the value for the interest that the code is supposed to compute?

    If you don't know what the code is supposed to do, it is very hard to write a...
  10. Replies
    35
    Views
    2,332

    Re: Programming Exercise Help

    Can you post some sample numbers for the variables: annualInterest and interest?

    For example: 24 and 2
  11. Replies
    35
    Views
    2,332

    Re: Programming Exercise Help

    I'm trying to determine what you want that line of code to do. What value of annualInterest is used in the equation? What value do you want to be assigned to the variable: interest? Can you give...
  12. Replies
    35
    Views
    2,332

    Re: Programming Exercise Help

    Can you give an example of the calculation with actual numbers?
    For example: 20.0/12 = 1.66667
  13. Replies
    35
    Views
    2,332

    Re: Programming Exercise Help

    Can you give an example of the calculation with actual numbers?
    For example: 20.0/12 = 1.66667
  14. Replies
    35
    Views
    2,332

    Re: Programming Exercise Help

    Can you give an example of the calculation with actual numbers?
  15. Replies
    35
    Views
    2,332

    Re: Programming Exercise Help

    Use the println() method to print its value so you can see what it is.


    interest = (int) ((double)annualInterest / 12);
    What value for interest do you want from this statement?
    Can you give an...
  16. Replies
    35
    Views
    2,332

    Re: Programming Exercise Help

    The error message says that the code on line 53 tried to divide by zero. Since that is not defined the jvm threw an exception.

    The code should test that the divisor is not zero before trying to...
  17. Replies
    35
    Views
    2,332

    Re: Programming Exercise Help

    Can you give more details about what the problem is? Copy the output, paste it here and add some comments saying what is wrong and show what you want the output to be.
Results 1 to 17 of 17