Results 1 to 3 of 3
  1. #1
    ace_03 is offline Member
    Join Date
    Nov 2009
    Posts
    8
    Rep Power
    0

    Default Need help coding

    //declare two intss, numberOfZeroes and numberOfOnes
    //loop through each char, similar method to the one in isWellFormed
    //if char is 1, then numberofzeros++, if char is 0, numberofzeros++
    //if (even)
    //do some math to figure out if the value is even or odd. Hint: Modulus (%) division
    //if number of ones is even, add a 0
    //else add a 1 (or is it the other wa around? read it)
    //using newasci.concat(ascii).concat("1") or 0
    //else for if even == false
    //number of ones is even, add a 1
    //else add a 0
    //return newascoo
    //profit

  2. #2
    collin389 is offline Senior Member
    Join Date
    Nov 2009
    Posts
    235
    Rep Power
    6

    Default

    It sounds like you already know what to do. Show us what you have done so far and tell us where you are having problems. We aren't going to write it for you.

  3. #3
    xcallmejudasx's Avatar
    xcallmejudasx is offline Senior Member
    Join Date
    Oct 2008
    Location
    Houston, TX & Flint, MI
    Posts
    609
    Rep Power
    7

    Default

    That's really clear pseudo code. Just convert that directly into java and post what you get. We can go from there.
    Liberty has never come from the government.
    Liberty has always come from the subjects of government.
    The history of liberty is the history of resistance.
    The history of liberty is a history of the limitation of governmental power, not the increase of it.

Similar Threads

  1. Coding help
    By Java_Fanatic in forum New To Java
    Replies: 7
    Last Post: 10-15-2009, 05:37 AM
  2. Better coding
    By tomiu in forum New To Java
    Replies: 1
    Last Post: 04-09-2009, 08:19 PM
  3. swing coding
    By priya_gurnani166 in forum AWT / Swing
    Replies: 8
    Last Post: 01-30-2009, 08:18 AM
  4. coding help
    By accies76 in forum New To Java
    Replies: 5
    Last Post: 11-12-2008, 09:15 PM
  5. Help with program coding
    By cachi in forum AWT / Swing
    Replies: 1
    Last Post: 07-31-2007, 08:16 AM

Posting Permissions

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