Search:

Type: Posts; User: Norm

Search: Search took 0.16 seconds.

  1. Replies
    13
    Views
    1,368

    Re: Credit Card String Program

    What should the output be?
    Are the formulas you are using to compute the checkdigit correct?
    Do you get the correct result doing the math manually?
    If not then ,maybe you need to get the correct...
  2. Replies
    13
    Views
    1,368

    Re: Credit Card String Program

    It can NOT assign a value because it does not change the initial value of -1.
    Add a call to the println method (as suggest earlier in post#2) to print out a message with the values used to assign...
  3. Replies
    13
    Views
    1,368

    Re: Credit Card String Program

    That means the code never assigns a value to checkDigit. Time for some debugging to see why it does not assign a value.
  4. Replies
    13
    Views
    1,368

    Re: Credit Card String Program

    Where is the variable: checkDigit assigned a value? Is that line of code executed?
    To see, change this line:

    private int checkDigit = -1; //<<<<<<<<<<<

    and see what prints...
  5. Replies
    13
    Views
    1,368

    Re: Credit Card String Program

    Can you change the Scanner definition as I showed above in post #4 so that it provides the answers to the questions that the program asks. With that change there will be no chance a user can enter...
  6. Replies
    13
    Views
    1,368

    Re: Credit Card String Program

    What prints out when the debugging println statements are executed?


    Can you provide all the input that the user must make to test the program?

    An easy way to make sure the program reads the...
  7. Replies
    13
    Views
    1,368

    Re: Credit Card String Program

    Where is the code that creates that last digit? How have you tried to debug it so you'd understand why the digit is always 0? Add a println statement to print out the values of the variables used...
Results 1 to 7 of 7