Home > Software engineering >  VB homework. Please help.. Thank you very much
VB homework. Please help.. Thank you very much

Time:10-27

Command1_Click preparation process, input x, n, according to the following formula for calculating the value of polynomial y, requires the use of the Select Case statement,
X2 + 1 n=1, 2, 3
Y=X1/3-5 n=5
8 + x2 X3-1 & lt;=n

CodePudding user response:

N in different values, x and y in a different way of calculation, piecewise function.
This as long as you take a look at the select syntax description and course can understand.

CodePudding user response:

Won't you?

CodePudding user response:

 Sub test () 
Dim n As Integer
Dim As Double y
Dim x As Double
'the input values
N=5
The Select Case n
Case 1, 2, 3
Y=x ^ 2 + 1
The Debug. Print y
Case 5
Y=x ^ (1/3) - 5
The Case Is & gt;=8
Y=x ^ 3 + x ^ 2-1
End the Select
MsgBox 'output the answer y
End Su
b
  •  Tags:  
  • VBA
  • Related