Search:

Type: Posts; User: Norm

Search: Search took 0.11 seconds.

  1. Replies
    23
    Views
    2,801

    Re: Help With Putting This Math Problem Into Code

    This assignment makes no sense. This program does less than you can do with a calculator.
    Are you sure you understood what the program is supposed to do?
  2. Replies
    23
    Views
    2,801

    Re: Help With Putting This Math Problem Into Code

    There is only one assignment statement that needs to be in the program: the one that sets the value of x. The rest of the assignment statements(there are about 12 of them) do nothing useful and can...
  3. Replies
    23
    Views
    2,801

    Re: Help With Putting This Math Problem Into Code

    How are you trying to print it? System.out.println("x=" + x);
    Please post the code with the problem.
  4. Replies
    23
    Views
    2,801

    Re: Help With Putting This Math Problem Into Code

    You only need to assign the value to x. The rest of the code doesn't do anything.
    What more do you need besides the value of x?

    Check you algebra. The formula for calculating x doesn't look...
  5. Replies
    23
    Views
    2,801

    Re: Help With Putting This Math Problem Into Code

    Its the bold statement in post#10
  6. Replies
    23
    Views
    2,801

    Re: Help With Putting This Math Problem Into Code

    I gave you the whole thing in my last post.

    I did not check your algebra, but it does not look like the right formula.
  7. Replies
    23
    Views
    2,801

    Re: Help With Putting This Math Problem Into Code

    Type it into the program just as you wrote it with the correction:
    double x = 5000 - 23/3.0;
    You have shown that you know how to enter an assignment statement here:
    double day3 = 3 *(2 + (x +...
  8. Replies
    23
    Views
    2,801

    Re: Help With Putting This Math Problem Into Code

    That looks like a very simple statement to enter in a program. Have you tried it?
    One problem will be with integer division: 23/3 = 7 no decimal places. 23/3.0 will give decimal plaxes
  9. Replies
    23
    Views
    2,801

    Re: Help With Putting This Math Problem Into Code

    What do statement? That was a typo. corrected now

    If you have the formula to compute the value of x, have you tried coding it, compiling it and executing it? What happens?
  10. Replies
    23
    Views
    2,801

    Re: Help With Putting This Math Problem Into Code

    The variable totalkm will only have the value from the last assignment statement. The values stored into it by the other assignment statements will be gone.

    To assign a value to the variable: x...
  11. Replies
    23
    Views
    2,801

    Re: Help With Putting This Math Problem Into Code

    What do you have so far? Please post the code and ask specific question about the problems you are having.
Results 1 to 11 of 11