Search:

Type: Posts; User: Norm

Search: Search took 0.08 seconds.

  1. Replies
    24
    Views
    2,986

    Re: Why isn't this code working?

    If you don't post the current code and its output, how can anyone help you fix it?
  2. Replies
    24
    Views
    2,986

    Re: Why isn't this code working?

    Post the new code and its output to show what is happening..
  3. Replies
    24
    Views
    2,986

    Re: Why isn't this code working?

    Move this line to just in front of where you print out the value of getTotalSold.
    Have these two line right next to each other.
    int getTotalSold = (s1.getNumSold() + s2.getNumSold() +...
  4. Replies
    24
    Views
    2,986

    Re: Why isn't this code working?

    You can not change the values used to compute a sum after you compute the sum.
    for example
    x = y+ z;
    y = y = 2;
    now x does not equal the current value of y + z because y has been changed/
  5. Replies
    24
    Views
    2,986

    Re: Why isn't this code working?

    Please Edit your post and wrap your code with
    <YOUR CODE HERE> to get highlighting
    You have used the wrong tags for the code.

    What does the justSold() method do? Does it change any of the data...
  6. Replies
    24
    Views
    2,986

    Re: Why isn't this code working?

    My suggestion might not work if the class is in a package and the class files are not in the correct folders.
  7. Replies
    24
    Views
    2,986

    Re: Why isn't this code working?

    Open a command prompt window change directory to the folder with the class file and enter:
    java <THECLASSNAME>
    If Test is the class with the main() method:
    Java Test
  8. Replies
    24
    Views
    2,986

    Re: Why isn't this code working?

    Can you use the java command to execute your program in a command prompt window?

    The output you posted is from the IDE not from the java program.
  9. Replies
    24
    Views
    2,986

    Re: Why isn't this code working?

    Please copy and paste here the console from when you execute the program.
    I see lots of println statements, some of them will print if the program executes.
Results 1 to 9 of 9