Computer Science Canada hELP! ALL CONVERSTIONS PROJECT.... |
Author: | hexx [ Mon Dec 09, 2002 6:12 pm ] | ||
Post subject: | hELP! ALL CONVERSTIONS PROJECT.... | ||
help me.... i have stupid project to do..... i finsihed decimal to all places..... i need to do: -binary to all bases -Hex to all bases and -Octal to all bases -------------------------------------------------------------------------------------- plz fix this HEX > DECIMAL prog for me:
|
Author: | Dan [ Mon Dec 09, 2002 6:43 pm ] | ||||||
Post subject: | hummm | ||||||
well i dont know what you are sposted to do for this progject excltey but you can use a comand in turing to covert bases. hex to dec
dec to hex
dec to binaery
the code for intstr is intstr ( i : int [ , width : int [ , base : int ] ] ) : string the code for strint is strint ( s : string [ , base : int ] ) : int P.S. some teachers dont like this method becuse they did not take the time to look at the strint and intstr fuctions. so they think this is a big progject. |
Author: | hexx [ Mon Dec 09, 2002 11:55 pm ] |
Post subject: | |
lol is IT THAT EASY? man... if i knew.. that but our teacher is amrking the code so i would apprecaite it someone could get me the LONG VERSION of this... thnx! |
Author: | Tony [ Tue Dec 10, 2002 12:14 am ] | ||
Post subject: | |||
well tell your teacher that its a bad programming practice to reinvent the wheel as the functions are already there, build in and ready to use. It saves time (therefor money), are executed faster and more accuratly and with no bugs (or less then your function). anyway, binary to decimal:
In other bases, you just replace d with base ** length(num) and replace /2 with /base that gotta convert every base to decimal for you. |