Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2015
    Posts
    2
    Rep Power
    0

    Default hi. please help me for this code

    double a = 12;
    double b =%20;

    double z = b - a;

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,422
    Blog Entries
    7
    Rep Power
    28

    Default Re: hi. please help me for this code

    What does =% mean?

    kind regards,

    Jos
    Build a wall around Donald Trump; I'll pay for it.

  3. #3
    Join Date
    Feb 2015
    Posts
    2
    Rep Power
    0

    Default Re: hi. please help me for this code

    Hi mean twenty persent (20%)

  4. #4
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,422
    Blog Entries
    7
    Rep Power
    28

    Default Re: hi. please help me for this code

    Quote Originally Posted by Barham_kurd0288 View Post
    Hi mean twenty persent (20%)
    20 percent of what? Can't you multiply that thing by 0.2? (<--- that is a hint)

    kind regards,

    Jos
    Build a wall around Donald Trump; I'll pay for it.

  5. #5
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    6,226
    Rep Power
    14

    Default Re: hi. please help me for this code

    Quote Originally Posted by JosAH View Post
    20 percent of what? Can't you multiply that thing by 0.2? (<--- that is a hint)

    kind regards,

    Jos
    At least the OP can post a percent sign! As I type this I keep wondering if this will work (no it didn't. I had to spell it out).

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  6. #6
    ssk2659 is offline Member
    Join Date
    Jan 2015
    Posts
    48
    Rep Power
    0

    Default Re: hi. please help me for this code

    You cannot write like double b =20% in Java. If it the problem says 20%, try to get the percentage of the number by applying simple algebraic calculation.

Similar Threads

  1. Replies: 1
    Last Post: 03-25-2012, 03:40 AM
  2. Replies: 16
    Last Post: 01-31-2012, 08:36 PM
  3. Replies: 3
    Last Post: 08-10-2011, 09:17 AM
  4. Replies: 0
    Last Post: 08-07-2011, 08:32 PM
  5. Replies: 1
    Last Post: 04-26-2007, 03:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •