I built a BMX jump from an old desk I welded up some time ago.
Time for some fun.
Most of my demos are going to use Visual Basic 2010 Express (a free development studio from Microsoft). This download is about 600MB.
Visual Studio Express 2012 requires Windows XP, Vista or Windows 7 with 2GB minimum of memory with 3GB hard drive space and a 1.6Ghz processor or more.
How to download and Installing Visual Studio Express 2010.
Future posts will show you how to develop programs in Visual Studio Express (Visual Basic) 2010. If you are a Mac user I will get into Apple’s Objective C with XCode but for now you can install Visual Studio in a Virtual Machine on OSX.
If you are keen read some of these guides.
Programming logic is a quick description of the flow of your program.
A very simple program logic may be
IF ITEM_PRICE < BANK_BALANCE THEN
Before we write the program above we need to identify what is data and what is language associated with the programming language.
Data would be BANK_BALANCE (that is a number) and ITEM_PRICE is a number too.
“IF” and “END IF” are commands available in this program. When dealing with data you can assign the data to a variable name, for example your bank balance (a number) can be saved in the variable MyBankBalance and your credit card balance can be saved in a variable called MyCreditCardBalance.
There are different types of variables used in Visual Studio 2010 – Visual Basic.
There are other types but you can read about them here: http://msdn.microsoft.com/en-us/library/ae55hdtk.aspxIf you have to choose one type of variable choose a string as it can hold almost anything.
With numbers try and use the variable with the smallest maximum to save using too much memory (e.g. If you were creating a variable to hold ones age use a Byte, if you were creating a variable to hold a bank balance use a Decimal over an integer mostly because Decimals allow decimal points where Integers round off anything after a decimal point.
Now what we have our programming logic decided our programming variables how can we optimize my program. Let’s say we want to check our primary bank balance then our secondary bank balance if the primary bank balance does not have enough money. If we duplicated the code that checks the bank balance that would work but the code would get twice as big. What we need to do is move the code that checks the bank balance into a FUNCTION called “CHECK_BANK_BALANCE” and pass in the name of the bank account to check. No we can check 1, 2 or 2000 bank balances without duplicating code.
The new code might look like
IF ITEM_PRICE < CHECK_BANK_BALANCE(BANK_ACCOUNT_NUMBER) THEN
The code above is not perfect, we do not have a breakdown of the check price function but pseudo code allows you to flesh out the structure of your program before you start coding.
Another alternative to using a function may be to use a “Sub” (Subroutine), A subroutine is like a function but it does not return any data. You could use a sub routine to deduct an amount from a bank balance and not return the bank balance when done.