幫我找找這本書的答案吧,謝謝啦vb程式設計》高等教育出版社鄭國平王傑華主編

時間 2022-01-30 11:08:32

1樓:匿名使用者

第一章:

一:選擇題

1-5 cccca 6-10 cbaca 11 a

二:填空題

1: 檢視 工具箱

2: 物件 事件驅動

3: ** 窗體設計器

4: 屬性 方法 事件

5: 物件的特徵

6: 乙個物件可執行的動作

7: 屬性視窗 賦值語句

三:簡答題

1:略2:略

四:程式設計題

【屬性視窗設定】

caption 這是我的第乙個練習

【**視窗設定】

private sub form_click()

print "我可以用visual basic語言編寫程式了!"

end sub

第二章:

一:選擇題

1-5: bddca

6-10: cbadd

11-15: ddbdb

16-20: dbcdc

21-23: ccd

二:填空題

1: value

2: 下拉列表框

3: scroll

4: largechange

5: ascii碼

6: enabled

7: listcount

8: popupmenu

9: alt

10:複選

11:commondialog1.showcolor 或者: showcolor

12:flags

13: 1

14:-

15:gfed

第三章一:選擇題

1-5: adadc

6-10: bcbdb

11-15:bbcbb

16-20:dcada

21-25:abcbb

26-30:dbbcb

31-34:bbdd

二:填空題

1: right(cstr(x),1) & left(cstr(x),1)

2: x mod 5=0 or x mod 9=0

3: false

4: cdef

5: s>="a" and s<="z" or s>="a" and s<="z"

6: x>=0 and x<100

7: int(rnd*(x-2)+3)

8: sqr(cos(23*3.14/180)/(x^2*log(y)))

9: -4 -5 -4

10:"請輸入圓的半徑:" "求圓的面積" 2

11:"圓的半徑值必須介於1到10之間,請重輸" 48 "求圓的面積"

第四章一:選擇題

1-5: dcdac

6-10: ccbdc

二:填空題

1: 4.8

202: y=11

3: 1!+2!+3!+4!+5!

4: 9

k(學生我認為該題有錯,應把其中的 n 改成 k)

5: 0

n6: 2

7: x>=0

x>max

8: 5 7

13 12

14 11

9: sum=0

sum+j

st & k & "+"

10: 4

1110

11: i + 1

list1.removeitem j

12: combo1.list(i)=combo1.text

flag=false

combo1.additem combo1.text

三:程式設計題

1:private sub form_click()

dim x as single

x = val(inputbox("請輸入乙個x的值:"))

if x <= 0 then

fx = -1

elseif x < 1 then

fx = sqr(x)

else

fx = x ^ 3 + 2

end if

msgbox ("運算結果為:" & fx)

end sub

2:private sub form_click()

dim n as integer, k as integer, s as string

n = val(inputbox("請輸入乙個正整數:"))

k = 2

s = n & "="

doif n mod k = 0 then

s = s & k & "*"

n = n \ k

else

k = k + 1

end if

loop until n = k

s = s & k

print s

end sub

3:private sub form_click()

dim s as string, i as integer

dim a as integer, b as integer, c as integer, d as integer, e as integer

s = text1.text

for i = 1 to len(s)

if mid(s, i, 1) >= "0" and mid(s, i, 1) <= "9" then

if val(mid(s, i, 1)) mod 2 <> 0 then

a = a + 1

else

b = b + 1

end if

elseif mid(s, i, 1) >= "a" and mid(s, i, 1) <= "z" then

c = c + 1

elseif mid(s, i, 1) >= "a" and mid(s, i, 1) <= "z" then

d = d + 1

else

e = e + 1

end if

next i

print "奇數個數為:"; a

print "偶數個數為:"; b

print "大寫字母個數為:"; c

print "小寫字母個數為:"; d

print "其他字元個數為:"; e

end sub

4:private sub form_click()

dim n as integer, sum as integer

n = val(inputbox("請輸入乙個正整數:"))

do until n = 0

sum = sum + n mod 10

n = n \ 10

loop

msgbox ("各位數字之和為:" & sum)

end sub

5:private sub form_click()

dim n as long, i as integer, l as integer

n = val(inputbox("請輸入乙個正整數:"))

l = len(cstr(n))

for i = 1 to l / 2

if mid(cstr(n), i, 1) <> mid(cstr(n), l, 1) then

exit for

end if

l = l - 1

next i

if i > l / 2 then

msgbox ("該數是回文數。")

else

msgbox ("該數不是回文數。")

end if

end sub

6:private sub command1_click()

dim a as integer, b as integer, c as integer

for a = 1 to 30

for b = 1 to 30

for c = 1 to 30

if a ^ 2 + b ^ 2 = c ^ 2 and a < b then

print a, b, c

end if

next c

next b

next a

end sub

第五章一:單選題

1-5: bcbbd

6-8: dab

二:程式設計題

1:option base 1

private sub command1_click()

dim a(15) as integer, i as integer, j as integer

doj = int(rnd * 90) + 10

if j mod 2 <> 0 then

i = i + 1

a(i) = j

label1.caption = label1.caption & str(a(i))

end if

loop until i = 15

for i = 1 to 14

for j = i + 1 to 15

if a(i) < a(j) then

t = a(i)

a(i) = a(j)

a(j) = t

end if

next j

label2.caption = label2.caption & str(a(i))

next i

label2.caption = label2.caption & str(a(i))

end sub

2:option base 1

private sub form_click()

dim a(10) as integer, i as integer, max as integer, min as integer, sum as integer

for i = 1 to 10

a(i) = int(rnd * 90) + 10

print a(i);

sum = sum + a(i)

next i

print

max = a(1)

min = a(1)

for i = 2 to 10

if a(i) > max then

max = a(i)

elseif a(i) < min then

min = a(i)

end if

next i

print "最大數為:"; max

print "最小數為:"; min

print "平均值為:"; sum / 10

end sub

3:private sub form_click()

dim a(0 to 25) as integer, idx as integer, i as integer, s as string, ch as string * 1

s = inputbox("請輸入乙個字串:")

print "輸入的字串為:"; s

for i = 1 to len(s)

ch = mid(s, i, 1)

if ch >= "a" and ch <= "z" then

idx = asc(ch) - asc("a")

a(idx) = a(idx) + 1

elseif ch >= "a" and ch <= "z" then

idx = asc(ch) - asc("a")

a(idx) = a(idx) + 1

end if

next i

print "統計結果如下:"

for i = 0 to 25

print chr(asc("a") + i); ":"; a(i); "次"

next i

end sub

4:option base 1

private sub form_click()

dim a() as integer, m as integer, n as integer

dim i as integer, j as integer, max as integer

m = val(inputbox("請輸入行數:"))

n = val(inputbox("請輸入列數:"))

redim a(m, n)

for i = 1 to m

for j = 1 to n

a(i, j) = int(rnd * 90) + 10

print a(i, j);

if a(i, j) > max then max = a(i, j)

next j

print

next i

print

for i = 1 to m

for j = 1 to n

if a(i, j) = max then

print "最大元素是:"; a(i, j);

print "行號:"; i;

print "列號:"; j

end if

next j

next i

end sub

5:option base 1

private sub form_click()

dim a(5, 5) as integer, i as integer, j as integer

dim sum1 as integer, sum2 as integer, sum3 as integer

print "隨機生成陣列元素:"

for i = 1 to 5

for j = 1 to 5

a(i, j) = int(rnd * 9) + 1

print a(i, j);

sum3 = sum3 + a(i, j)

if i = 1 or i = 5 or j = 1 or j = 5 then

sum2 = sum2 + a(i, j)

end if

next j

print

next i

for i = 1 to 5

sum1 = sum1 + a(i, i) + a(i, 6 - i)

next i

sum1 = sum1 - a(3, 3)

print "對角線元素之和為:"; sum1

print "所有靠邊元素之和為:"; sum2

print "所有陣列元素之和為:"; sum3

end sub

6:option base 1

private sub form_click()

dim a() as integer, b() as integer, n as integer, k as integer, i as integer, j as integer

n = val(inputbox("請輸入n=", , 9)) + 1

redim a(n + 1, n + 1), b(n + 1, n + 1)

k = 8

for i = 1 to n

for j = 1 to i

a(i, 1) = 1

a(i, i) = 1

a(i + 1, j + 1) = a(i, j) + a(i, j + 1)

b(i, j) = a(i, j)

print b(i, j); " ";

next j

print

next i

end sub

第六章:

一:填空題

1: afbecd

2: -5

53: 246

84: 33

5: 5

無輸出6: 1234

107: 0

8: 12 10

9: 246

710: 3 54 2 0 5 17 23

二:程式設計題

1:private sub form_click()

dim s as string, n as integer

s = inputbox("請輸入待轉數s=", "n進製轉十進位制")

n = val(inputbox("請輸入該數的進製n=", "n進製轉十進位制"))

print convert(s, n)

end sub

private function convert(byval s as string, byval n as integer) as integer

dim i as integer, j as integer

for i = len(s) to 1 step -1

convert = convert + mid(s, i, 1) * n ^ j

j = j + 1

next i

end function

2:要麼由於資質太低,要麼題意敘述不清。此題答案,僅供參考。

private sub form_click()

dim y as single, n as integer, t as single

t = 1 / 2

y = t

n = 1

do until t <= 1e-5

n = n + 1

t = t / (2 * n)

y = y + t

loop

print y

end sub

3:option base 1

dim a() as integer

private sub command1_click()

dim n as integer, i as integer

n = val(inputbox("請輸入資料個數", "工程1", 10))

redim a(n)

for i = 1 to n

a(i) = int(rnd * 90) + 10

text1 = text1 & cstr(a(i)) & " "

next i

end sub

private sub command2_click()

dim max as integer, min as integer, i as integer, temp as integer

call max_min(max, min)

for i = 1 to ubound(a)

if a(i) = max then

temp = a(1)

a(1) = a(i)

a(i) = temp

exit for

end if

next i

for i = 1 to ubound(a)

if a(i) = min then

temp = a(ubound(a))

a(ubound(a)) = a(i)

a(i) = temp

exit for

end if

next i

for i = 1 to ubound(a)

text2 = text2 & cstr(a(i)) & " "

next i

end sub

private sub max_min(max as integer, min as integer)

dim i as integer

max = a(1): min = a(1)

for i = 2 to ubound(a)

if a(i) > max then

max = a(i)

elseif a(i) < min then

min = a(i)

end if

next i

end sub

private sub command3_click()

text1.text = ""

text2.text = ""

command1.setfocus

end sub

4:設計介面時:要將文字框的multiline屬性設定成true

scrollbars屬性設定成 2

private sub command1_click()

dim i as integer

for i = 1000 to 9999

if mid(i, 1, 1) = mid(i, 4, 1) and prime(i) and prime(exchange(i)) and i < exchange(i) then

text1 = text1 & "(" & i & " " & exchange(i) & ")" & vbcrlf

end if

next i

end sub

private function prime(n as integer) as boolean

dim k as integer

for k = 2 to sqr(n)

if n mod k = 0 then exit function

next k

prime = true

end function

private function exchange(n as integer) as integer

dim t as string * 1, s as string

s = cstr(n)

t = mid(s, 2, 1)

mid(s, 2, 1) = mid(s, 3, 1)

mid(s, 3, 1) = t

exchange = s

end function

private sub command2_click()

text1.text = ""

command1.setfocus

end sub

private sub command3_click()

endend sub

《童年》這本書怎麼寫讀後感,童年這本書的讀書筆記怎麼寫

今天,當我閱讀 高爾基的童年 這篇文章後,被文中高爾基那種讀書時忘記一切,專心致志的態度所感染。我一字一句地仔細閱讀時,彷彿和高爾基在一起讀書。他讀得那麼專心,把世界上的一切都忘記了。讀到這裡,我情不自禁想起了自己以前讀書的情景。每當父母給我買回新書或自己借到一本書,我就如魚得水,總是迫不及待地閱讀...

菜根譚這本書名是怎樣來的,菜根譚這本書怎麼樣

菜根譚 問世於明代萬曆年間,作者洪應明,字自誠,明末隱士。作者所處盼時代,政治紛擾昏暗 人心浮動不安 道德淪喪 法紀不彰,洪應明故而退隱不讓,只專心埋首於著述。其著述計有 樵淡 筆疇 傳家寶 等,內容多是當時的警句教言,幷包含自身的感慨,既為自律,也為勸世。雖然流傳於今的並不多,但 菜根譚 一書卻影...

幫我找找論史記中刺客形象的,幫我找找論史記中刺客形象的資料

關於刺客,可以參考司馬遷史記中的 刺客列傳 刺客列傳 全文五千多字,共寫了曹沬 專諸 豫讓 聶政 荊軻五個人,而其中單是荊軻乙個人就用了三千多字,可見荊軻是司馬遷這篇作品要表現的核心人物。節選部分主要記敘了 荊軻刺秦王 的故事,敘述了這一事件的前因後果,從準備 實施 到最後失敗,事件過程完整。情節圍...

幫我找找這歌的出處

歌名就叫幻想神域 幻想神域 主題曲 瞳 閉 描 空 君 聲 閉上眼睛 描繪天空 聴 胸 心中始終能聽到你的聲音 縛 世界 描 理想 心中描繪的理想同被束縛的現實 時間 鎖 斷 切 時間的枷鎖無法斬斷 溢 出 不安 探 明日 湧出的不安和探求的明天 刻 君 絆 永不停息地刻下與你的羈絆 日誓 希望葉 ...

《平凡的世界》這本書說的內容是什麼?

挺好的一本書,寫得是20世紀六七十年代的在乙個村里發生的事情,和他們的內心感情,以及社會的變革,20世紀70年代中到80年代中期中國北方農村的生活和變遷。地點是黃土高原的乙個虛構的小村雙水村及附近的縣城。主要人物是雙水村農民孫玉厚 兒子孫少安 孫少平 女兒孫蘭花 孫蘭香 一家和幹部田福軍 女兒田曉霞...