Computer Science Canada

Binary converter

Author:  Nizzem [ Wed Apr 06, 2005 2:13 pm ]
Post subject:  Binary converter

I need to write a program that converts binary up to 2 bytes to either hexadecimal or decimal. I can think of a few ways to go about it but they all seem bulky with a lot of unnecessary code. So I was wondering if anyone could give me a few tips on how to go about writing this program.

Author:  Delos [ Wed Apr 06, 2005 3:40 pm ]
Post subject: 

The Search does work!

Return 1
Return 2
Return 3

And of course there are a lot of other examples available, some even superior to those listed...

[edit]
Forgot to answer your question...
Though, if you're looking for tips...there are various ways of converting between bases. You can look into String Manipulation to make handling of numbers easier (sometimes). If you want to tighten your code, use as many functions as possible (procedures are good, but functions are a little more versitle).
Whatever method you've been taught to convert bases...is most likely as good as it's going to get. Work with that, see if you can create a good piece of pseudo-code before you tackle it w/ OOT (pseudo-ing cannot be stressed enough...).


: