Лабораторная работа: Завдання з програмування на Visual Basic
For i = 1 To nt(i) = i
Next
End If
If var$ = "б)" Thenn = 4
t(1) = 1.5: t(2) = 3: t(3) = 0.6: t(4) = 0.9
End If
WordBasic.Insert "Варiант - " & var$ & "; n =" & Str(n)
WordBasic.InsertPara: WordBasic.Insert "y = "
For i = 1 To n
WordBasic.Insert Str(t(i)) & "; "
Next
WordBasic.InsertPara: WordBasic.InsertPara
WordBasic.Insert "| y | x | p | z |"
WordBasic.InsertPara
For i = 1 To n
y = t(i)
x = (Log(y) + a * Cos(c)) / (Exp(y) - Tan(a) - Sin(c) ^ 2)
If x > y Then p = Sin(x) + Sqr(Abs(x - y)) * Sin(b) ^ 2
If x = y Then p = 1.35 * x ^ 2
If x < y Then p = Log(Abs(x + 1.45 * y)) * Tan(b * c)
z = p + 0.5 * b ^ 2 + Cos(p - a)
WordBasic.Insert Str(y) & "|" & Str(x) & "|" & Str(p) & "|" _
& Str(z) & "|"
WordBasic.InsertPara
Next
End Sub
При виборі варіанта а) отримаємо такий результат:
a = 4.32
b = 6.89