Search:

Type: Posts; User: Norm

Search: Search took 0.12 seconds.

  1. [SOLVED] Re: Making Binary Converter script from scratch, running into math issue.

    What you see is not what you get.
    The problem with printing out '1' and 1 is that they print out the same. But your code was using the char in an formula that showed you that '1' was not 1. This...
  2. [SOLVED] Re: Making Binary Converter script from scratch, running into math issue.

    You need to convert/parse the char value if you want to convert a '1' to a 1.
    A quick and dirty way to do that is to subtract '0' from it.
    '1' - '0' = 1
  3. [SOLVED] Re: Making Binary Converter script from scratch, running into math issue.

    Did you enter a 1 or a 2 also????

    You need to simplify the input for testing. Change the input to one digit: 1
    Add printlns with labels that say what is being printed to the code to show the...
  4. [SOLVED] Re: Making Binary Converter script from scratch, running into math issue.

    You did not show what the input you entered for the program.

    Why do you read the input as int vs as String?
  5. [SOLVED] Re: Making Binary Converter script from scratch, running into math issue.

    Can you show the program's input and output?
    Add some comments to the output showing what you want it to be.
Results 1 to 5 of 5