Constants are like variables in their declarations and the ability to look at the value stored inside them, however you can not change the values while the program is running, the value of a constant remains (rather unsurprisingly) constant.
Example: Declaring pi as a constant
Const pi asSingle=3.14
If you try to change a constant value it will bring up an error. They are very useful for values that do not change or rarely change such as VAT, pi, e, etc. By using a constant you don't run the risk that you might accidentally change the value, you wouldn't want to accidentally change pi to equal 4 as All your calculations would go wrong!
Write a program that works out the area and circumference of a circle, setting pi to a constant. Use the equations: area = Πr2 and circumference = 2Πr For example:
Insert radius: 5
area = 78.5398163
circumference = 31.4159265
const pi assingle=3.14
dim r assingle
console.write("Insert radius: ")
r = console.readline()
console.writeline("area = "& pi * r * r)
console.writeline("circumference= "&2* pi * r)
Write a program that works out the cost of two clothing items showing the price, VAT, and price inclusive of VAT. VAT = 17.5%. For example