Visual Basic/Visual Basic (Programming)
Would you mind helping me please?
Instructions say: Write a Dim statement for each of the following variables using the variable name that would be best for each value.
a. The population of the state of Alaska
b. Your weekly pay
c. The smallest data type you can use for your age
d. A constant for the first initial of your first name
e. The minimum wage
f. The name of the city in which you live
g. The answer to a true/false question
The common rule to Name variables is to give them meaningful names, like for the name - strName with String type, for somebody's age - NumOfYears with one of the numerical types: Double, Integer etc. You can choose yourself anything just meaningful. Let's look at a: population cannot be Double or String or Decimal - it's only Integer or Long (for really big numbers). There are not that many people in Alaska so it's Integer. So for a - just out of my mind - this is the statement:
Dim iPopulationOfAlaska As Integer
the variable name is starting with i - so if you happens to see iPopulationOfAlaska in code you already know it is an Integer. Common is to use str prefix for String variables, dbl for Double, lng for Long, dec for Decimal.
Using the same common sense those are my suggestions: again you can choose something different, but it should be meaningful.
b. Dim dblMyWeekPay As Double
c. Dim byteMyAge As Byte (Byte is in the range from 1 to 256)
d. Const strMyFirstInitial As String = "D"
(as you can see there is a special statement "Const" to define constants)
e. Dim dblMinWage As Double
f. Dim strMyCity As String
g. Dim bAnswer As Boolean