Professional Documents
Culture Documents
Chapter3 CT
Chapter3 CT
1) A. First_Name
-Age_On_2010_1_1
- lastName
- GPA
B. -Sub (this is illegal because it is a reserved word)
-10var (starts with a digit)
-A-B (has a - which is used for subtraction operator)
-First Name (illegal because there is a space in between)
3) A. 13
B. 11
4) It allows the user to enter a value.
6) A. Prompt
7) A. Integer
B. Decimal
C. Integer
D. Double
E. Boolean
F. Char
8) A. Local
B. Its shows us that the value will appear when the button is pressed
9 A. 8
B. 8
C. 4
D. 12
E. 12
10) When x is 2005, 0 is assigned to y. When x is 1776, 0 is assigned to y.
And When x is 39, 3 is assigned to y. in general, the result of this expression
is the tens digit of a number.
11) A. Variable,
Dim numVotes As Integer
B. Variable
Dim Percentage won As Double
C. Constant
Dim Initials As String
D. Constant
Dim Year As Integer
12) a. Syntax error, Dim num As Integer = 6
b. Syntax error, num = Val(Me.TxtNum.Text)
c. Syntax error, lblOutput.Text = message
d. Logic error, avg = (test1 + test2) / 2
e. Logic error, Dim numberTest As Integer = 2
f. Logic error, Me.lblEmptySeats.Text = MAX_CLASS_SIZE + currentsize
13) 0
14) a. A = 1 * w
b. P = (R C) / N
c. A = h * (b1 + b2) / N
d. V = (4 / 3) * PI * r ^ 3
e. A = (F + S + T) / 3
f. P = (5 * F) / (4 * d ^ 2)
g. A = P + P * r * t
h. M = (P * r * (1 + r) ^ n) / ((1 + r) ^ n 1)
i. x = (-b * (b * b 4 * a * c) ^ (1 / 2)) / (2 * a)
15) a. 1 = A / w
b. R = P * N + C
c. b1 = N * A / h b2
d. r = (.75 * V / PI) ^ (1 / 3)
e. T = 3 * A - F S
f. F = (4 * P * d ^ 2) / 5
g. P = A / (1 + r * t)
h. P = (M * (1 + r) ^ n 1) / (r * (1 + r) ^ n)
16) a. T
b. F (Only Multiple variables of the same type can be declared in a single
statement)
c. T
d. F (The val() function converts text box data to a numeric value)
e. T
f. F (it represents true or false)
g. T
h. T
i. F (x is assigned the value 6)