Search:

Type: Posts; User: Norm

Search: Search took 0.20 seconds.

  1. Replies
    19
    Views
    2,388

    Re: Whats Wrong? Beginning Code!

    You gave a good answer, but I'm not sure the OP ever figured out what was causing the / by zero error. I don't know if he ever saw that the value of interest was 0, causing 1/interest to cause the...
  2. Replies
    19
    Views
    2,388

    Re: Whats Wrong? Beginning Code!

    @ChicoTheMan94 And now the OP will not have the pleasure of finding the problem himself, let alone the things he might learn about how to find problems in code.
  3. Replies
    19
    Views
    2,388

    Re: Whats Wrong? Beginning Code!

    Where do you print out the values of all the variables used in this statement:

    loanAmt/((1/interest)-(1/(interest*Math.pow(1+interest,months))));

    especially those to the right of any /s?

    The...
  4. Replies
    19
    Views
    2,388

    Re: Whats Wrong? Beginning Code!

    Did you print out the values of all the expressions that are used as divisors (what is to the right of the / operator). For example with this: 12/(a+b) you should print out (a+b)

    Where do you...
  5. Replies
    19
    Views
    2,388

    Re: Whats Wrong? Beginning Code!

    Call the println method to print out the variables used in the statement where the error happens:
    System.out.println("yourVar="+ yourVar);

    Replace yourVar with the name of the variable in your...
  6. Replies
    19
    Views
    2,388

    Re: Whats Wrong? Beginning Code!

    Did you find what variable was zero?
    If not, add a println() statement to print out the values of all the variables used in the divisor to see.
  7. Replies
    19
    Views
    2,388

    Re: Whats Wrong? Beginning Code!

    Look at the code on line 59 and make sure the divisor is not 0.
    Break the code up into simple statements that do one thing at a time and find out why the results are 0.

    Print out the values of...
  8. Replies
    19
    Views
    2,388

    Re: Whats Wrong? Beginning Code!

    There are two variables named: custName. One a String and one an int. It does not make sense to have a name that is int.
    Is the posted code the same code that you are getting the "cannot find...
Results 1 to 8 of 8