[單項(xiàng)選擇題] 在窗體上畫一個名稱為Command1的命令按鈕,然后編寫如下事件過程:Private Sub Command1_Click () Dim a
2021-07-20
[單項(xiàng)選擇題] 在窗體上畫一個名稱為Command1的命令按鈕,然后編寫如下事件過程:Private Sub Command1_Click () Dim a As Integer, b As Integer, c As Integer a = 1: b = 2: c = 3 Print fun2 (c, b, A)End SubPrivate Function funl (x As Integer, y As Integer, z As Integer) fun1 = 2 * x + y + 3 * zEnd FunctionPrivate Function fun2(x As Integer, y As Integer, z As Integer) fun2 = fun1(z, x, y)+ xEnd Function程序運(yùn)行后,單擊命令按鈕,則窗體上顯示的內(nèi)容是
A.7
B.14
C.17
D.30
正確答案:B解析:[分析]: 對于多個過程或函數(shù)依次調(diào)用的處理和簡單過程調(diào)用處理一樣,本題先調(diào)用函數(shù) fun2,而函數(shù)fun2又調(diào)用函數(shù)fun1,結(jié)果返回的順序是從fun1到fun2,fun2計算后輸出到調(diào)用的地方。只要注意函數(shù)的調(diào)用關(guān)系依次處理即可解決此類問題。
詞條內(nèi)容僅供參考,如果您需要解決具體問題
(尤其在法律、醫(yī)學(xué)等領(lǐng)域),建議您咨詢相關(guān)領(lǐng)域?qū)I(yè)人士。