2022年2022年江西财大数据库课后习题答案 .pdf





《2022年2022年江西财大数据库课后习题答案 .pdf》由会员分享,可在线阅读,更多相关《2022年2022年江西财大数据库课后习题答案 .pdf(4页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、1 答案不一定正确,参考时一定要自己运行一下。(1)题 if 结构Public Sub Z_X_Y() Dim x, y, z As Double x = Val(InputBox( 请输入 x) y = Val(InputBox( 请输入 y) If x y Then z = x + y Debug.Print z ElseIf x = y Then z = x * y * Sgn(y) Debug.Print z ElseIf y 0 Then z = x / y Debug.Print z Else Debug.Print z 没有值 End If End Sub (1)题 case结构
2、Public Sub Z_X_Y2() Dim x, y, z, a As Double x = Val(InputBox( 请输入 x) y = Val(InputBox( 请输入 y) a = y - x Select Case a Case Is 0 z = x + y Debug.Print z Case 0 z = x * y * Sgn(y) Debug.Print z Case Else If y 0 Then z = x / y Debug.Print z Else Debug.Print z 没有值 End If End Select End Sub (2)题Public S
3、ub 一元二次方程 () Dim a, b, c, deta, x1, x2 As Double a = Val(InputBox( 请输入系数a) b = Val(InputBox( 请输入系数b) c = Val(InputBox( 请输入系数c) deta = b * b - 4 * a * c If deta = 1 And x = 6 Then Debug.Print 星期 & Str(x) Exit Do ElseIf x = -1 Then Exit Do Else MsgBox (输入数据错误 ) End If Loop End Sub 单循环嵌套单分支结构:4(6) (9)
4、(10) (14)(6)题Public Sub 整除 3 或 5() Dim i, n As Integer n = 0 For i = 100 To 200 Step 5 If i / 3 = Int(i / 3) Then n = n + 1 Debug.Print i End If Next Debug.Print 个数为 + Str(n) End Sub 名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 1 页,共 4 页 - - - - - - - - - 2 (4)题Pub
5、lic Sub 行李收费 () Dim an, cn, weight, s_w, distance, fee As Double an = Val(InputBox( 请输入成年人数量) cn = Val(InputBox( 请输入未成年人数量) weight = Val(InputBox( 请输入行李重量 ) distance = Val(InputBox( 请输入距离 ) s_w = weight - 20 * an - 10 * cn If s_w max Then max = a(i) End If If a(i) min Then min = a(i) End If Next s =
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 2022年2022年江西财大数据库课后习题答案 2022 江西 数据库 课后 习题 答案

限制150内