Upload
eric-campbell
View
216
Download
3
Embed Size (px)
Citation preview
Q A1
Load
- Dim mark as integer = 77 :
If mark >=90 thenGrade="A"
Else if mark>=80 thenGrade ="B"
ElseGrade = "C"
End ifMessagebox.show(Grade)
c
-3 Const pi as single = 3.14
date String Cdate
String Phone
now
num Dim num as Single = 85/(2+4)*3
(cint(num))messagebox.Show
42
mark
Double
Interpreter
: Select Case
: + - &
Messagebox
StartPosition
Tuesday, March 24, 2015 7 1
Q A1
Method Visible
If (x>10) and (y0) then
("x= "&x)Messagebox.showElse
("Y="&y)Messagebox.show
End IF
Dim x , y as integerX=10
Y=5If (x
Q A1
: Textbox3
TextBox1.Text=5TextBox2.Text=7
TextBox3.Text=Textbox2.Text + Textbox1.Text
75
: False Enabled
: a
A=10 mod 5
0
:
InputBox
FormClosing
num Dim num As Single num= 3 - 1(5 - 2)/ Mod 2
MessageBox.Show(Cint(num))
2.66667
Load
Dim Sales as integer=10000Select Case Sales
Case is >10000Bonus=800
Case 5000 To 10000Bonus = 500
Case ElseBonus=0
End SelectMessagebox.Show("Bonus = " & Bonus)
: Bonus
500
-3 Declare StudentName As String
Ctype
Tuesday, March 24, 2015 7 3
Q A1
Date Birthdate
: InputBox
: Scrollbars
Compiler
: IFEnd IF
: '
msgbox
StartPosition
Method Enabled
Select Case Grade
Case is >=60Messagebox.show("Pass")
Case ElseMessagebox.show("Fail")
Else
End Select
Dim X As Integer=10Dim Y As Integer=2
If (X > Y) Xor (X Y) ThenMessageBox.Show("False")
ElseMessageBox.Show("True")
End If
TRUE
FlowChart
: A xor Not B and C
A =False , B = True , C=False
FALSE
Tuesday, March 24, 2015 7 4
Q A1
Or OrElse
: Show
ForeColor
: Button1 Button1.Enabled=False
: end
Solution Explorer Solution
Boolean
TextBox1.Text=2TextBox2.Text=3
TextBox3.Text=cint(Textbox2.Text) + cint(Textbox1.Text)
5
: False Visible
: a
A=4/2 mod 3
2
: MessageBox
value - reference types
String
Dim num as Integer num
now
Declare StudentName As String
Double price
Select Case
Tuesday, March 24, 2015 7 5
Q A1
Dim grade as double = 90Dim result as String
If Grade >=90 and Grade =80 thenResult = " very good "
End if Result
Excellent
Load
FlowChart
: A or B and CA =True , B = False , C=True
TRUE
Dim x , y as integerX=10
Y=5If (x10) and (y0) thenDim x, y As Integer
If (x > 10) And (y 0) Then MessageBox.Show("x=" & x)
Else MessageBox.Show("Y=" & y)
End IF
: IFEnd IF
Boolean
TextBox1.Text=2TextBox2.Text=3
TextBox3.Text=cint(Textbox2.Text) + cint(Textbox1.Text)
5
: MessageBox.show
Tuesday, March 24, 2015 7 6
Q A1
: False Visible
..... BackColor
: Exit
: Textbox3
TextBox1.Text=5TextBox2.Text=7
TextBox3.Text=Textbox2.Text + Textbox1.Text
75
: False Enabled
: InputBox
: Scrollbars
: '
Solution Explorer Solution
: num
num=8/2 mod 3
1
num Dim num As Double
num = (3 - 1) * (5 - 1) / 2 Mod 5 MessageBox.Show(num)
4
Tuesday, March 24, 2015 7 7