Search:

Type: Posts; User: Pinares

Search: Search took 0.09 seconds.

  1. Thread: Balloon code

    by Pinares
    Replies
    12
    Views
    1,421

    Re: Balloon code

    The problem is solved. using
    myBalloon.adjustAltitude(myBalloon.getAltitude() - 100); would mean add the altitude to itself (doubling it) then subtracting 100. by jusing
    myBalloon.adjustAltitude(...
  2. Thread: Balloon code

    by Pinares
    Replies
    12
    Views
    1,421

    Re: Balloon code

    It just replaces the altitude to w.e is in the argument. The current altitude at the time of that first statement is 250, and when i subtract 100 it gives me 400 in the output.
  3. Thread: Balloon code

    by Pinares
    Replies
    12
    Views
    1,421

    Re: Balloon code

    I posted the class definition. The adjustAltitude method adjusts the altitude to w.e. i put it as long as its > 0. When I call it in the statement
    myBalloon.adjustAltitude(myBalloon.getAltitude() -...
  4. Thread: Balloon code

    by Pinares
    Replies
    12
    Views
    1,421

    Re: Balloon code

    its on a different file in my src folder.

    --- Update ---

    When I replace the adjustAltitude methods in
    myBalloon.adjustAltitude(myBalloon.getAltitude() - 100); and ...
  5. Thread: Balloon code

    by Pinares
    Replies
    12
    Views
    1,421

    Re: Balloon code

    It gave me wrong outputs.
  6. Thread: Balloon code

    by Pinares
    Replies
    12
    Views
    1,421

    Re: Balloon code

    the blue should produce that the first balloon's alt is 250 - 100, 150. instead it gives 400, and the next should say its alt is at the same, instead it stays at its own.
Results 1 to 6 of 7