You are on page 1of 3

1a) length, ay, ay1, book

b) 1stjump (Can't have a number first),


?a (can't have a symbol in front),
#ofcats (can't have a symbol first),
ayy.lmao (Can't have a period, it means something specific)

2a) Dim numCards As Integer


numCards = 5

b) Dim numCards As Integer = 5

3a) 13 b) 11

4a) To get user input

5) If the textbox contains data that doesnt match the variable type you would
normally get an error but the Val() prevents this by converting the textbox data to a
numeric value which can be put with the variable type.

6a) Prompt b) To tell what kind to input is expected

7a) Integer b) Decimal c) Integer d) Double e) Boolean f) Character

8a) Values b) 0 because value is local and does not carry onto the 2nd button.

9a) 8 b) 8 c) 4 d) 12 e) 12

10) 2005: 0, 1776: 7, 39: 3

11) a)Dim numboats As integer


b)Dim percentage Integer
c)Dim Label Double
d)Dim Year As Double

12) Syntax error


Dim sum As Integer = 6

14.A) Public Class Form1


Dim Width As Integer
Dim Area As Integer
Dim Length As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Width = TextBoxWidth.Text
Length = TextBoxLength.Text
LabelArea.Text = Width * Length
End Sub
End Class
B) Public Class Form1
Dim R As Integer
Dim C As Integer
Dim N As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
R = TextBoxR.Text
C = TextBoxC.Text
N = TextBoxN.Text
Label5.Text = R - C / N
End Sub
End Class
C) Public Class Form1
Dim F As Double
Dim S As Double
Dim T As Double
Dim U As Double
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
F = TextBoxF.Text
S = TextBoxS.Text
T = TextBoxT.Text
U = (F + S + T) / 3
Label3.Text = U
End Sub
End Class

16.A) T
B) F
C) T
D) F
E) T
F) F
G) T
H) T
I) F

You might also like