inf1


Objętość stożka

Private Sub Command3_Click()

Dim R As Single

Dim H As Single

Dim wynik As Single

Dim pi As String

If IsNumeric(Text1.Text) = False Then

MsgBox "Nie poprawna wartość R"

Exit Sub

Else

R = CSng(Text1.Text)

End If

If IsNumeric(Text2.Text) = False Then

MsgBox "Nie poprawna wartość H"

Exit Sub

Else

H = CSng(Text2.Text)

End If

pi = 3.14

If R <> 0 Then

If H <> 0 Then

wynik = pi * 1 / 3 * R ^ 2 * H

Else

MsgBox "stożek nie istnieje"

End If

MsgBox "objętość stożka = " & wynik

End If

End Sub

Private Sub Command4_Click()

End

End Sub

Pole elipsy

Private Sub Command1_Click()

Const pi = 3.14

Dim a, b As Single

Dim S As Single

a = CSng(Text1.Text)

b = CSng(Text2.Text)

a = Val(Text1.Text)

b = Val(Text2.Text)

If IsNumeric(Text1.Text) = False Then

MsgBox "Niepoprawne dane wejściowe"

Exit Sub

End If

If IsNumeric(Text2.Text) = False Then

MsgBox "Niepoprawne dane wejściowe"

Exit Sub

End If

If a <= 0 And b <= 0 Then

MsgBox "Niepoprawne dane wejściowe"

Else

S = pi * a * b

MsgBox "Pole elipsy jest równe" & S

End If

End Sub



Wyszukiwarka

Podobne podstrony:
lista 3 inf1 w3
lista 6 inf1 w6 dod
INF1 2011 Prac 07
sylabus technol inf1
lista 6 inf1 w6
INF1 2011 Wykl 07 Dzienne 4na1
inf1, Studia, UTP Ochrona środowiska, I rok, Semestr II, Informatyka
INF1
lista 6, inf1 w6
lista 3, inf1 w3
INF1 2012 Wykl 02 Zaoczne
INF1 2011 Wykl 07 Dzienne 4na1

więcej podobnych podstron