Results 1 to 9 of 9

Thread: Binary Program, Trace Table Needed!

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2007
    Posts
    3

    Binary Program, Trace Table Needed!

    Hi i need to create a trace table for a piece of code that was given to me for my studies, how ever we have been given no lessons on how to do it, and i cant seem to find any where that explains it. The idea of the program is to convert decimal numbers to binary. Well here is the code;

    Code:
    Value = 1
    Do While DecimalNumber <> 0
        Digit = (DecimalNumber Mod 2)
        BinaryNumber = BinaryNumber & Digit
        DecimalNumber = DecimalNumber \ 2
        Value = Value * 2
    Loop
    Output BinaryNumber
    I need to Dry-run the code starting with DecimalNumber equal to 7 and again with DecimalNumber equal to 254. Below is what i have done however it has been marked wrong;




    Can anyone help, or know a good tutorial on how to do these, thx in advance.
    Attached Images Attached Images  

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width