Hello HF!
Today i'm gonna show how to work around with Variables.
First we need to know what a "Variable" is?
Well a Variable or a Set of Variables might be a logic set of Attributes or a symbol that represents a value or a quantity in a Algebric Expression.
The variable UserName, for example,
might have the value Plank, and the variable Discount might have the value 0.65. UserName and
Discount are variable names, and Plank and 0.65 are their values. Plank is a string (that is, text),
and 0.65 is a numeric value. When a variable’s value is a string, it must be enclosed in double
quotes. In your code, you can refer to the value of a variable by the variable’s name.
For this Tutorial, You need: Visual Basic 2010 Express
Little Experience in VB.net
Set of Tools:
* 1 Button (Simple Tutorial as it is :D )
First of all open Vb 2010 and Choose "Windows Forms Application".
Spoiler (Click to View)
Now Select a Button from the ToolBox and add it to the Form.
Now here is the part where the coding starts.
Switch to "Code View" and type
This will declare the "Amount" of your Product as a Decimal
Now add,
Now this will declare your "Discount" as a Decimal too.
Now put,
Now we have declared the Discounted Amount as a Decimal
Then we have to put in the values of the Amount and Discount. So,
Amount = 2500
Discount = 0.65
(You can change the Values Accordingly)
Now you must put "D" (Capital D) in-front of the discount value so it's value can be treated as a Decimal, Like:
Now All the values have been assigned, Now the Discount Calculation Code:
For N00bs this code is read as,
Then to view the Discount Decimal Value:
For N00bs, this code will display your calculated DiscountedAmount as a Message Box. So after putting together the whole code it will look like this :
Spoiler (Click to View)
And this ends my Simple and Easy to understand N00b Friendly tutorial in understanding Variables.. :D
Tutorial Written By Me
Note:
Today i'm gonna show how to work around with Variables.
First we need to know what a "Variable" is?
Well a Variable or a Set of Variables might be a logic set of Attributes or a symbol that represents a value or a quantity in a Algebric Expression.
The variable UserName, for example,
might have the value Plank, and the variable Discount might have the value 0.65. UserName and
Discount are variable names, and Plank and 0.65 are their values. Plank is a string (that is, text),
and 0.65 is a numeric value. When a variable’s value is a string, it must be enclosed in double
quotes. In your code, you can refer to the value of a variable by the variable’s name.
For this Tutorial, You need: Visual Basic 2010 Express
Little Experience in VB.net
Set of Tools:
* 1 Button (Simple Tutorial as it is :D )
First of all open Vb 2010 and Choose "Windows Forms Application".
Spoiler (Click to View)
Now Select a Button from the ToolBox and add it to the Form.
Now here is the part where the coding starts.
Switch to "Code View" and type
Code
Dim Amount As DecimalThis will declare the "Amount" of your Product as a Decimal
Now add,
Code
Dim Discount As DecimalNow this will declare your "Discount" as a Decimal too.
Now put,
Code
Dim DiscountedAmount As DecimalNow we have declared the Discounted Amount as a Decimal
Then we have to put in the values of the Amount and Discount. So,
Amount = 2500
Discount = 0.65
(You can change the Values Accordingly)
Now you must put "D" (Capital D) in-front of the discount value so it's value can be treated as a Decimal, Like:
Code
Discount = 0.65DNow All the values have been assigned, Now the Discount Calculation Code:
Code
DiscountedAmount = Amount * (1 - Discount)For N00bs this code is read as,
Code
DiscountedAmount: 2500 * (1 - 0.65)Then to view the Discount Decimal Value:
Code
MsgBox("Your Discount Amount/Value is $" & DiscountedAmount)For N00bs, this code will display your calculated DiscountedAmount as a Message Box. So after putting together the whole code it will look like this :
Spoiler (Click to View)
And this ends my Simple and Easy to understand N00b Friendly tutorial in understanding Variables.. :D
Tutorial Written By Me
Note:

![[Image: HdRuE.png]](https://i.imgur.com/HdRuE.png)
![[Image: uMxH6.png]](https://i.imgur.com/uMxH6.png)