Results 1 to 3 of 3
Thread: Need help coding
- 11-25-2009, 01:08 AM #1
Member
- Join Date
- Nov 2009
- Posts
- 8
- Rep Power
- 0
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
- 11-25-2009, 02:19 AM #2
Senior Member
- Join Date
- Nov 2009
- Posts
- 235
- Rep Power
- 4
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.
- 11-25-2009, 05:16 PM #3
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
-
Coding help
By Java_Fanatic in forum New To JavaReplies: 7Last Post: 10-15-2009, 04:37 AM -
Better coding
By tomiu in forum New To JavaReplies: 1Last Post: 04-09-2009, 07:19 PM -
swing coding
By priya_gurnani166 in forum AWT / SwingReplies: 8Last Post: 01-30-2009, 07:18 AM -
coding help
By accies76 in forum New To JavaReplies: 5Last Post: 11-12-2008, 08:15 PM -
Help with program coding
By cachi in forum AWT / SwingReplies: 1Last Post: 07-31-2007, 07:16 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks