reset password
Author Message
304374842
Posts: 56
Posted 13:28 May 07, 2016 |

Has anyone had any luck with this one? I am really stuck. My string binary number (binary to decimal) gives a runtime error when I try to run it and for decimal to binary I can't seem to get the loop working right.  Any advice?

kknaur
Posts: 540
Posted 13:34 May 07, 2016 |

The biggest hint I can give with this one is try converting a few by hand.  See which parts of the operation are repetitive and that will give you an idea of what part should be in the loop and how to design the loop.  Keep note of exactly what you do and how the values change. 

Also, what specific runtime error are you getting? Sometimes it help to google the errors to see what they mean if you do not know right away.

rcamach7
Posts: 31
Posted 15:38 May 07, 2016 |

What are you trying to do to convert the binary string to a decimal? At some point your program has to convert the string to digits, I don't know if that's where your problem is.

For the second part check the slides from week one I believe to give you a better idea of how to convert properly. 

304374842
Posts: 56
Posted 18:40 May 07, 2016 |

Yeah. I have been following the slides from week 1 to convert and for some reason it starts doing the calculations right and then starts switching.

I am working on the string issue, too. Not sure why it isn't parsing correctly.