Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Binary converter
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Nizzem




PostPosted: 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.
Sponsor
Sponsor
Sponsor
sponsor
Delos




PostPosted: Wed Apr 06, 2005 3:40 pm   Post subject: (No 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...).
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: