Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.Math
- Public Class Form1
- Dim stupanj As Integer = 0
- Dim vrijednost As Double = 0
- Private Sub stupanj_tbox_TextChanged(sender As Object, e As EventArgs) Handles stupanj_tbox.TextChanged
- stupanj = stupanj_tbox.Text
- koef_listbox.Items.Clear()
- koef_label.Text = "Koeficijent a" & koef_listbox.Items.Count
- vrijednost_listbox.Items.Clear()
- End Sub
- Private Sub upisi_button_Click(sender As Object, e As EventArgs) Handles upisi_button.Click
- If koef_listbox.Items.Count <= stupanj Then
- koef_listbox.Items.Add(CInt(koef_tbox.Text))
- koef_tbox.Text = ""
- koef_tbox.Focus()
- koef_label.Text = "Koeficijent a" & koef_listbox.Items.Count
- Else
- For x As Integer = -5 To 5
- For k As Integer = 0 To stupanj
- vrijednost += koef_listbox.Items(k) * Pow(x, k)
- Next
- vrijednost_listbox.Items.Add(vrijednost)
- vrijednost = 0
- Next
- End If
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement