Variables: • Collins Dictionary: Something that is variable changes quite often, and there usually seems to be no fixed pattern to these changes. Constants: • Collins Dictionary: A constant is a thing or value that always stays the same.
CC215 VB .NET (LAB 3) 4- Differentiate between Declaration, Initialization, and Assignment of variables in VB.net. Declaration Declaration is an act of defining a variable(s) A declaration states the type of a variable, along with its name. A variable can be declared only once. Throwing away the old value of a variable and replacing it with a new one. Initialization: • It's a special kind of assignment: the first. • Before initialization objects have null value and primitive types have default values such as 0 or false. • Can be done in conjunction with declaration. Assignment: Throwing away the old value of a variable and replacing it with a new one. 5- Explain the ways of assigning values to variables in VB.net. The ways of assigning values to variables in vb.net is: Dim varName As Type • Getting your data into a variable • Using the equals sign (=) • Make sure all variables are first declared before assignment For examples: intLength = 20 strName = "David" strFullName = strFirstName & " " & strLastName strTitle = ""
CC215 VB .NET (LAB 3) 6- State THREE (3) of the naming rules in vb.net. The some naming rules in vb.net: a. can only use letters, numbers, and underscores (_) b. must start with a letter or underscore c. cannot have spaces 7- Define the following: - (i) Scope of Variables:
- Winter '20
- .NET Framework, Microsoft Visual Studio