正在加载图片...
3选择结构一I条件语句 例331 Weight= InputBox("输入西瓜重量:","计算西瓜款") If Weight 4 Then Price=1 4公斤以下:100元/公斤 4至7公斤:13元/公斤 Elself weight <=7 Then 超过7公斤:1.1元/公斤 Price=1.3 Else If Weight< 4 Then Price=1 Price=1.1 If Weight >=4 And Price <=7 Then Price=1.3 If Weight >7Then Price=1.1 End If Money= price* Weight MsgB0x“西瓜重”& Weight&“公斤,单价”& Pice&k"元,应收瓜款"& Money&-陆西瓜款 "元","计算西瓜款 西瓜重8公斤,单价1.1元,应收瓜款8.8元 返回目录 匚确定3.1 选择结构-If条件语句 [例3.3] Weight = InputBox("输入西瓜重量:", "计算西瓜款") If Weight < 4 Then Price = 1 ElseIf Weight <= 7 Then Price = 1.3 Else Price = 1.1 End If Money = Price * Weight MsgBox “西瓜重”& Weight & “公斤,单价”& _ Price & "元,应收瓜款" & Money & _ "元", , "计算西瓜款" 返回目录 4公斤以下:1.00元/公斤 4至7公斤: 1.3元/公斤 超过7公斤:1.1元/公斤 If Weight < 4 Then Price = 1 If Weight >= 4 And Price <= 7 Then Price = 1.3 If Weight > 7 Then Price = 1.1
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有