读程序:指出错误 Dim h As Single Dim w As Single Dim b As Single b=w/h h = Val(Text 1. Text) w = Val(Text 2. Text) Label 4. Caption = Str(b)
读程序:指出错误 Private Sub Command 2_Click() Label 4. Caption = 你好中国 End Sub 为什么没有任何显示?
区分输入输出语句 n 输入: – H=val(text 1. text) n 输出: – Label 3. caption=str(c) – Text 1. text=str(c) – List 1. add str(c)
块if结构 If 条件 then 语句系列 1 Else 语句系列 2 End 开始 Y 条件 执行a N 执行b if If Mid(sfz, 17, 1) Mod 2 = 0 Then s = s + "女" Else s = s + "男" End If 行if结构 结束 If 条件 then 语句系列 1 else 语句系列 2 If Mid(sfz, 17, 1) Mod 2 = 0 Then s = s + "女" Else s = s + "男"
块if结构 If 条件 then 语句系列 1 Elseif 条件 then 开始 Y 执行a 语句系列 2 N 条件 Y 条件 Else N 语句系列 3 End 执行b 结束 if 执行C If fs >= 90 Then Label 6. Caption = "优秀!" Else. If fs >= 60 Then Label 6. Caption = "及格!" Else Label 6. Caption = "不及格!" End If
思考: If fs >= 90 Then Label 6. Caption = "优秀!" Else. If fs >= 60 Then Label 6. Caption = "及格!" Else Label 6. Caption = "不及格!" End If n fs >= 60要不要写成”fs >= 60 and fs<90”?