Well, why don't you first off set a limit as to maximum number of bits that the largest number that can be read in can be.
Then, you find out how many bits are in the number.
Then, if there is a 1 in that bit position, add in 2 raised to the power of that bit position to your running total.
Do this from left to right, stripping off each bit as you do so.
The answer should be the decimal equivalent of that binary number. (Check it by using the Calculator on your computer to see if you did this right

)
Also, a binary number only has 0's and 1's. Any number with digits other than 0's and 1's isn't binary. That should be enough information for you to test if it is binary or not.