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

Username:   Password: 
 RegisterRegister   
 very basic decimal --> binary converter
Index -> Programming, Turing -> Turing Submissions
Goto page Previous  1, 2
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
ZeroPaladn




PostPosted: Fri Sep 30, 2005 11:10 am   Post subject: (No subject)

this is what i get for not being on compsci for the entire summer... anyways, i've yet to get much work done on the project, mainly cause its all math (aaaaarrrrrgggggghhhhh!) slowly but surely, its coming tho.
Sponsor
Sponsor
Sponsor
sponsor
[Gandalf]




PostPosted: Fri Sep 30, 2005 7:34 pm   Post subject: (No subject)

Did you get something like so:
code:
var inputNum : int
var binaryOut : array 1 .. 8 of int := init (0, 0, 0, 0, 0, 0, 0, 0)

get inputNum

for count : 1 .. 8
    if inputNum mod 2 = 1 then
        binaryOut (count) := 1
    else
        binaryOut (count) := 0
    end if
    inputNum := inputNum div 2
end for

for decreasing count : 8 .. 1
    put binaryOut (count) ..
end for


Oops, wrong thread, but it's about the same thing anyway Surprised.
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 2 of 2  [ 17 Posts ]
Goto page Previous  1, 2
Jump to:   


Style:  
Search: