Wednesday, March 2, 2011

PROGRAM READABILITY

MEANINGFUL IDENTIFIERS

I use dim of course, sHex, sDec, SOct. it is use for converting a number to the decimal, hexadecimal and octal.

LOGIC STRUCTURE

for the iteration that i use is if then else statement and do while loop.

CODE PRACTICE

Dim tmp As String
Dim n As Long

n = DecimalNum

tmp = Trim(Str(n Mod 2))
n = n \ 2

Do While n <> 0
tmp = Trim(Str(n Mod 2)) & tmp
n = n \ 2
Loop

DecToBin = tmp

NOTES AND COMMENTS

I didn't use comments because you will know what is their function of each code.


PROGRAM DOCUMENTATION

PROGRAM LISTING

I use Text Box when you would enter a number and another text box for showing the answer.

I use Option Box for choosing the decimal, Hexadecimal and Octal.


PROGRAM SPECIFICATION

for this program I use Visual Basic 6.0, then this program shows what will be the convertion of the number you enter.

FILE LAYOUT AND RECORD DESCRIPTION

none

OPERATING INSTRUCTIONS

I use text box for entering a number, then in the option box you can choose what will you be converted with.








No comments:

Post a Comment