VB Trace Table Help!

Associate
Joined
2 Dec 2004
Posts
138
Location
oxford
Hi All, I have been asked to create a trace table from the following piece of Code:
Code:
Value = 1
Do While DecimalNumber <> 0
    Digit = (DecimalNumber Mod 2) ‘= Number DIVIDE Number
    BinaryNumber = BinaryNumber & Digit
    DecimalNumber = DecimalNumber \ 2
    Value = Value * 2
Loop
Output BinaryNumber
I have been researching this for a while but i still don't understand how i can create a trace table with this code. I have been given what values to run through "starting with DecimalNumber equal to 7 and again with DecimalNumber equal to 254. "

Then suggest any code changes...

If anyone could help me it would be greatly appreciated.

Thanks,

Iceman911
 
Last edited:
Thank you for your reply. Is this what the trace table should look like. Sorry for my ignorance but my Course is not a programming course, but has this unit in it :confused:

Value
Value 1
DecimalNumber 7
Digit 3.5
BinaryNumber 3.5
DecimalNumber 1.75
Value 3.5
Output 0000111

Thank you.

Iceman911
 
Back
Top Bottom