求《程序设计基础》课后题答案

求《程序设计基础》课后题答案,第1张

第一章 VB程序设计概述

二、选择题

CADAB ACDAB CBDBB

第二章 VB可视化编程基础

二、选择题

ABDCA CACBC DADAD BDBBB

三、填空题

1可视 2LEFT TOP WIDTH HEIGHT

3按字母序 4查看代码 5工具、选项

6Form1 Font 7Multiline

8只读属性

9工程 属性 通用 Form1show

10tabindex 0

第三章 VB语言基础

二、选择题

BCADB ADBBC DBCBA BAABB

三、填空题

1整型、长整型、单精度、双精度

2sin(30314/180)+sqr(x+exp(3))/abs(x-y)-log(3x)

3160 今天是:3-22

4False

5-4 3 -3 3 -4 4

6“CDEF”

7(x mod 10)10+x\10

8(35\20)20=20 ( 35 \ 20 ) 20 = 20

9x mod 3=0 or x mod 5=0

10276 82 8 1 100 397 true false

第四章 VB程序控制结构

二、选择题

DBCAD ABBAB D25BAC CBACB DAABC

三、填空题

1正确性、有穷性、可行性、有输入、有输出

21 2 3

3x>7

4x<amin 51024 611 712 86 I “”;

90 100 i+1 102I 6 “”;

三、编程题

1 Private Sub Form_Click()

Dim n As Integer, i As Integer, s As Long

s = 1

n = Val(InputBox("请输入一个整数:"))

For i = 1 To n

s = s i

Next i

MsgBox n & "!=" & s

End Sub

2.Private Sub Form_Click()

Dim i%, k%

For j = 3 To 100

k = Int(Sqr(j))

For i = 2 To k

If j Mod i = 0 Then Exit For

Next i

If i > k Then

y$ = y$ & " " & j

End If

Next j

MsgBox y, , "显示质数"

End Sub

3.Private Sub Form_Click()

Dim i%, s%

For i = 1 To 100

s = s + i

Next i

MsgBox "1+2+3+……+100=" & s

End Sub

4.Private Sub Form_Click()

Dim x%, y%

For x = 1 To 50

For y = 1 To 33

z = 100 - x - y

If 2 x + 3 y + 05 z = 100 Then

Print "小鸡、公鸡、母鸡分别为:"; x; y; z

End If

Next y

Next x

End Sub

5Private Sub Command1_Click()

Dim a%, b%, c%, p!, s!

do

a = Val(InputBox("请输入三角形的第一条边"))

if a=-1 then exit do

b = Val(InputBox("请输入三角形的第二条边"))

c = Val(InputBox("请输入三角形的第三条边"))

If a + b > c And a + c > b And b + c > a Then

p = (a + b + c) / 2

s = Sqr(p (p - a) (p - b) (p - c))

Print s

Else

MsgBox "你输入的三边不能构成三角形,请重新输入"

End If

loop

End Sub

6 Private Sub Form_Click()

Dim i As Integer, j As Integer,k as integer

For i = 1 To 8

For k=1 to 8-i

Print spc(3);

Next k

For j = 1 To 2 i - 1

Print i;

Next j

Print

Next i

End Sub

7 Private Sub Form_Click()

Dim i As Integer, j As Integer, k As Integer

For i = 1 To 30

For j = 1 To 30

For k = 1 To 30

If i ^ 2 + j ^ 2 = k ^ 2 Then

Print i & " ^ 2 + " & j & "^ 2 =" & k & "^ 2"

End If

Next k

Next j

Next i

End Sub

8.Private Sub Form_Click()

Dim x As Integer, a As Integer, b As Integer, c As Integer, ss As String

ss = ""

For x = 100 To 999

a = Int(x / 100)

b = Int((x - 100 a) / 10)

c = x - 100 a - 10 b

If a ^ 3 + b ^ 3 + c ^ 3 = x Then

ss = ss & " " & x

End If

Next x

Print ss

End Sub

9.Dim sr As Long, r As Single

sr = Val(InputBox("请输入收入:"))

Select Case sr

Case Is < 200

r = 0

Case 200 To 400

r = (sr - 200) 004

Case 400 To 5000

r = sr 004

Case Is >= 5000

r = sr 005

End Select

Print "收入为" & sr & "时所缴纳的税为:" & r

End Sub

10Private Sub Form_Click()

Dim t As Single, wf As Single

t = Val(InputBox("请输入上网时间:"))

Select Case t

Case Is < 10

wf = 50

Case 10 To 60

wf = t 6

Case Is >= 60

wf = t 4

End Select

If wf >= 200 Then

wf = 200

End If

Print "上网时间为" & t & "小时上网的费用为:" & wf

End Sub

11 Private Sub Form_Click()

Dim yf As Integer

yf = Val(InputBox("请输入月份"))

Select Case yf

Case 12, 1, 2

MsgBox yf & "月份是冬季"

Case 3, 4, 5

MsgBox yf & "月份是冬季"

Case 6, 7, 8

MsgBox yf & "月份是冬季"

Case 9, 10, 11

MsgBox yf & "月份是冬季"

Case Else

MsgBox "输入错误,请重新输入"

End Select

End Sub

12if的方法

Private Sub Form_Click()

Dim x As Single, f As Single

x = Val(InputBox("请输入一个数"))

If x < 0 Then

f = 2 x - 1

ElseIf x = 0 Then

f = 4 x

ElseIf x > 0 Then

f = 7 x - 5

End If

Print "f(" & x & ")=" & f

End Sub

Select case语句:

Private Sub Form_Click()

Dim x As Single, f As Single

x = Val(InputBox("请输入一个数"))

Select Case x

Case Is < 0

f = 2 x - 1

Case 0

f = 4 x

Case Is > 0

f = 7 x - 5

End Select

Print "f(" & x & ")=" & f

End Sub

第五章 数组

一、选择题

DCACD DBCDC BADAD

二、填空题

1名称 Index 2preserve 3变体 42

3

51 2 3 1 4 1 61 2 3 2 4 6 7 max max=arr1(i)

三、编程题

1 Option Base 1

Private Sub Form_Click()

Dim a(10) As Integer, i%, temp%

For i = 1 To 10

a(i) = Val(InputBox("请输入第" & i & "个整数"))

Next i

大学学习资料免费下载网 有类似资料

在 其他公共课程 版块

标题:陈东方 C语言程序设计基础实验与题解(答案)

中国物联网校企联盟技术部

以上就是关于求《程序设计基础》课后题答案全部的内容,包括:求《程序设计基础》课后题答案、求《C语言程序设计基础》的课后习题答案、等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zz/9983454.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-04
下一篇 2023-05-04

发表评论

登录后才能评论

评论列表(0条)

保存