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

Username:   Password: 
 RegisterRegister   
 BASE CONVERTER ANY BASE
Index -> Programming, Turing -> Turing Submissions
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
sport




PostPosted: Sun Mar 14, 2004 12:20 pm   Post subject: BASE CONVERTER ANY BASE

This is a base converter that converts numbers from base 2 to base 16 and anywhere in between. It is a two ways converter therefore it will convert any number from base 16 to base 2 and any base in between.

Note if you enter a higher base than 16 or a lower base than 2 it will tell you to reenter the base. To exit the program enter 0 at the
code:
CONVERTING FROM BASE: "
prompt.

Any suggestion on how to improve the program are welcomed.



base_converter.zip
 Description:
BASE CONVERTER

Download
 Filename:  base_converter.zip
 Filesize:  275.15 KB
 Downloaded:  428 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
recneps




PostPosted: Sun Mar 14, 2004 12:30 pm   Post subject: (No subject)

Question: Whats a base? :/
Tony




PostPosted: Sun Mar 14, 2004 2:36 pm   Post subject: (No subject)

base is the value-1 up to which a single digit can go

examples:
base 2 - binary. 0 or 1
base 10 - deca, regular numbers
base 16 - hex, ..9,A,B,C,D,E,F
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Paul




PostPosted: Sun Mar 14, 2004 5:49 pm   Post subject: (No subject)

oh this is useful, if I could only have used it during my test of binary, octal and hex conversion.
the_short1




PostPosted: Sun Mar 14, 2004 7:24 pm   Post subject: (No subject)

good stuff.. when did they make u do conversions??? compsci gr11??

nice programm and i learned something new today... what a BASE is.. ahaha lol
sport




PostPosted: Sun Mar 14, 2004 7:35 pm   Post subject: (No subject)

I wrote this program during a DWITE contest a while ago, just didn't get around to edit it and post it.
Homer_simpson




PostPosted: Mon Mar 15, 2004 5:44 pm   Post subject: (No subject)

i like how u got hex too...+bits
shorthair




PostPosted: Mon Mar 15, 2004 7:07 pm   Post subject: (No subject)

dude when he says any base he means it ,

*EDIT* no base 1
base2
base3
base4
........
base16

so the hex part isnt that impressive , the entire program is , i was with him when he did it , took him no time , he did an awsome job PROPS TO SPORT
Sponsor
Sponsor
Sponsor
sponsor
sport




PostPosted: Wed Mar 17, 2004 11:23 am   Post subject: (No subject)

One mistake it doesn't do base 1, because no one uses it and it will be just a bunch of zeros. However it does work with bases:2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 and 16.
Tony




PostPosted: Wed Mar 17, 2004 11:25 am   Post subject: (No subject)

well you could do base 1

0 = 1
00 = 2
000 = 3
Laughing
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
sport




PostPosted: Wed Mar 17, 2004 11:36 am   Post subject: (No subject)

I'm planning to do an improvement version which will have more graphic stuff and I'll probable go up to 32 to 64 base and I'll be sure to include base 1 Tony.
Homer_simpson




PostPosted: Thu Mar 18, 2004 3:25 am   Post subject: (No subject)

shorthair wrote:
dude when he says any base he means it ,

it does base 1

base2
base3
base4
base5
base6
base7
AND SO ON
so the hex part isnt that impressive , the entire program is , i was with him when he did it , took him no time


yo... you dunno jack sh|t about coding a program like this so dont spam pointlessly... Mad
shorthair




PostPosted: Thu Mar 18, 2004 7:21 am   Post subject: (No subject)

dude what was with hte flame " i made a slight mistake on hte accuracy of hte progam , by one base , the one i did for the ontest did base 1 " ........

He nd i wrotethat program at on of the contests , he finished his and i finished mine , it was a contest problem ... i know exactly ho to do it i got the 2nd highest mark in number conversion ( sport beat me ) ive been coding with him for over 2 years , and what was wrong with my post ,people were getting caught up in hte " common bases " i was lettin people know that other bases work aswell.

BACK THE HELL OFF
josh




PostPosted: Thu Mar 18, 2004 11:49 am   Post subject: (No subject)

This is really cool but a weird thing happend:

I told it to convert from base 5 to base 12 and I input 23 as the number to be converted. Instead of erroring it converted it. I do not know if this is correct but I thought that since the number was over 5 and I was entering a number in base 5 then it shoudln't convert.

i am sorry if I am incorect because I do not fulyl understand the concept of bases yet. If I am incorect I appologize and yo can call em an idiot. Very Happy

Really usefull though.
guruguru




PostPosted: Thu Mar 18, 2004 5:27 pm   Post subject: (No subject)

23 is a valid number in base 5. Base 5 contains 1, 2, 3, 4, and 5. If we converted it to our deciaml system, base 10, it would be around 12... I think... But yea it is a legal base 5 number.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 2  [ 21 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: