sintesi2

variante di sintesi:aumenta numero di elementi passati a procedura

Private Sub CommandButton1_Click()
h = TextBox1.Text
Select Case h
Case 1
s1 = "x^2-5x+4 >0"
s2 = "positiva per x <1 e x >4"

Image1.Visible = True
Call calcola(1, -5, 4, s1, s2)
Case 2
s1 = ("x^2-2x-8 <0")
s2 = ("negativa per x > -2 e x < 4 ")
Image2.Visible = True
Call calcola(1, -2, -8, s1, s2)
Case 3
s1 = ("4x^2-4x+1 >0")
s2 = ("sempre positiva, eccetto ove si annulla")
Image3.Visible = True
Call calcola(4, -4, 1, s1, s2)
Case 4
s1 = "x^2-2x+1 <0 "
s2 = ("impossibile:mai negativa")

Image4.Visible = True
Call calcola(1, -2, 1, s1, s2)
Case 5
s1 = ("x^2-4x+5 >0")
s2 = ("sempre vera:infinite soluzioni")
Image5.Visible = True
Call calcola(1, -4, 5, s1, s2)
Case 6
s1 = ("2x^2-3x+2 <0")
s2 = ("mai negativa:impossibile")
Image6.Visible = True
Call calcola(2, -3, 2, s1, s2)
Case 7
s1 = ("-2x^2 + 8x -4 >0")
s2 = ("positiva entro limiti indicati")
Image7.Visible = True
Call calcola(-2, 8, -4, s1, s2)
Case 8
s1 = ("-x^2 + 2x +2 <0")
s2 = ("negativa estenamente a limiti indicati")
Image8.Visible = True
Call calcola(-1, 2, 2, s1, s2)
Case 9
s1 = ("-4x^2 + 12x -9 >0")
s2 = ("impossibile, mai positiva")
Image9.Visible = True
Call calcola(-4, 12, -9, s1, s2)
Case 10
s1 = ("-x^2 + 4x -4 <0")
s2 = ("sempre negativa, eccetto ove si annulla")
Image10.Visible = True
Call calcola(-1, 4, -4, s1, s2)
Case 11
s1 = ("-x^2 + 2x -3 >0")
s2 = ("impossibile,sempre negativa")
Image11.Visible = True
Call calcola(-1, 2, -3, s1, s2)
Case 12
s1 = ("-2x^2 -12x -22 <0")
s2 = ("sempre negativa:infinite soluzioni")
Image12.Visible = True
Call calcola(-2, -12, -22, s1, s2)
End Select


End Sub

Private Sub CommandButton2_Click()
ListBox1.Clear
Image1.Visible = False
Image2.Visible = False
Image3.Visible = False
Image4.Visible = False
Image5.Visible = False
Image6.Visible = False
Image7.Visible = False
Image8.Visible = False
Image9.Visible = False
Image10.Visible = False
Image11.Visible = False
Image12.Visible = False

End Sub

Private Sub calcola(a, b, c, s1, s2)
ListBox1.AddItem (s1)
ListBox1.AddItem (s2)
v1 = (-b / (2 * a))
v2 = ((4 * a * c - b ^ 2) / (4 * a))
asse = (-b / (2 * a))
ListBox1.AddItem (v1 & " , " & v2)
ListBox1.AddItem ("asse = " & asse)
For k = -5 To 5
x = k
ListBox1.AddItem ("x = " & x & " ... y = " & a * x ^ 2 + b * x + c)
Next k
ListBox1.AddItem ("---------------------------")
End Sub


Private Sub CommandButton3_Click()
TextBox1 = ""
End Sub

Private Sub CommandButton4_Click()
Rem selezionare funzione da attivare
ListBox2.AddItem ("inserire numero da 1 a 12 ")
ListBox2.AddItem ("poi cliccare pulsante attivare")
ListBox2.AddItem ("------------------------")
ListBox2.AddItem ("x^2-5x+4 >0..........a>0 D>0 ....1")
ListBox2.AddItem ("x^2-2x-8 <0..........a>0 D>0 ....2")
ListBox2.AddItem ("4x^2-4x+1 >0.........a>0 D=0 ....3")
ListBox2.AddItem ("x^2-2x+1 <0..........a>0 D=0 ....4")
ListBox2.AddItem ("x^2-4x+5 >0..........a>0 D<0 ....5")
ListBox2.AddItem ("2x^2-3x+2 <0.........a>0 D<0 ....6")
ListBox2.AddItem ("-2x^2 + 8x -4 >0.....a<0 D>0 ....7")
ListBox2.AddItem ("-x^2 + 2x +2 <0......a<0 D>0 ....8")
ListBox2.AddItem ("-4x^2 + 12x -9 >0....a<0 D=0 ....9")
ListBox2.AddItem ("-x^2 + 4x -4 <0......a<0 D=0 ...10")
ListBox2.AddItem ("-x^2 + 2x -3 >0......a<0 D<0 ...11")
ListBox2.AddItem ("-2x^2 -12x -22 <0....a<0 D<0 ...12")
End Sub

vedi sintesi2.ppt