Search:

Type: Posts; User: Junky

Search: Search took 0.09 seconds.

  1. Replies
    16
    Views
    1,040

    [SOLVED] Re: Casting int and doubles variables

    A lesson to be learnt: I gave you the algorithm in several steps. If you cannot work it out in one (hard to read) line of code then break it down into several steps.
  2. Replies
    16
    Views
    1,040

    [SOLVED] Re: Casting int and doubles variables

    How many fargin times do you have to be told?

    43.75 - 43 = 0.75
    0.75 * 100 = 75.0
    (int) 75.0 = 75
  3. Replies
    16
    Views
    1,040

    [SOLVED] Re: Casting int and doubles variables

    Kewish just told you how. They took my advice and expanded upon it. Which I had hoped you would be able to figure it out for yourself.
  4. Replies
    16
    Views
    1,040

    [SOLVED] Re: Casting int and doubles variables

    When the double 43.75 is cast to an int you get 43. Obviously 43 - 43 = 0.
    What happens if you subtract gdpPerCapitaDollars from gdpPerCapita without casting? Note you will need to assign the result...
  5. Replies
    16
    Views
    1,040

    [SOLVED] Re: Casting int and doubles variables

    You say you have a problem but do not explain what that problem is. Perhaps post the desired output and the actual output you are getting.
Results 1 to 5 of 5