メニューに戻る

\( f(x,a)=0 \) の解を求めるPAD(探査範囲において単調増加する関数)について
VBA でプログラミングしなさい.

学籍番号 
氏  名 
(F)-(6)のPADにしたがうアルゴリズムを
1 行毎に下記の選択肢から適切に並べてVBAでプログラムにしなさい.
なお,解答は選択肢番号を入力する.選択不要な場所は 0 を入力する.
 ()   ()   ()   ()   () 
 ()   ()   ()   ()   () 
 ()   ()   ()   ()   () 
 ()   ()   ()   ()   () 
 ()   ()   ()   ()   () 
 ()   ()   ()   ()   () 
 ()   ()   ()   ()   () 
 ()   ()   ()   ()   () 
 ()   ()   ()   ()   () 
 ()   ()   ()   ()   () 
 ()   ()   ()   ()   () 
 ()   ()   ()   ()   () 
 ()   ()   ()   ()   () 
 ()   ()   ()   ()   () 
 ()   ()   ()   ()   () 
 ()   ()   ()   ()   () 
 ()   ()   ()   ()   () 
 ()   ()   ()   ()   () 
 ()   ()   ()   ()   () 

選択肢

(1)Do (2)Then (3)f(x,a) > 0
(4)xLo = x (5)eps > Er (6)Dim eps As Double
(7)Or (8)Else (9)Dim xLo As Double : xLo = Cells(4,2)
(10)Cells(5,2)= x (11)x = xLo (12)x = (xHi + xLo)/2
(13)x = xHi (14)Dim Er As Double : Er = Cells(2,4) (15)If
(16)eps = Abs(f(x,a)) (17)Next (18)While
(19)Dim a As Double : a = Cells(2,2) (20)And (21)L < 1000
(22)Dim L As Long : L = 0 (23)Loop (24)For
(25)xHi = x (26)End (27)Dim xHi As Double : xHi = Cells(3,2)
(28)Cells(6,2)= L (29)Dim x As Double : x = (xHi + xLo)/2 (30)L = L + 1