View Single Post
Old 01-21-2013, 05:02 PM   PM User | #11
dexter28
New to the CF scene

 
Join Date: Jan 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
dexter28 is an unknown quantity at this point
Can anyone help me do this please??
I've been stuck on this for a few weeks


The user enters 0010101 and 010100. These should be converted to decimal (21 and 20, respectively). The Finch will speak that: “The two numbers entered are 21 and 20. Their sum is 41 and when multiplied gives 420. Subtracting the two numbers gives 1”.
Please note that the program must *not* use a simple loop which tests for all 127 cases of decimal number in the case of the 7-binary digit number etc. The program must incorporate a proper algorithm for converting the number by parsing (i.e. searching) the string of bits.
The program should be tested with binary numbers input from the keyboard as well as from a file. You may decide how the two binary numbers in the file are formatted, e.g., one after the other or separated with a new line.
dexter28 is offline   Reply With Quote