Umfang_Kreis.vbs 468 B

1234567891011121314151617181920
  1. Option Explicit
  2. Dim Radius, Umfang, Flaeche
  3. Const Pi = 3.14159
  4. Radius = InputBox("Bitte Raduis eingeben.")
  5. If IsNumeric(Radius) Then
  6. Else
  7. MsgBox "Bitte nur aen eingeben.", vbcritical, "Fehler"
  8. End If
  9. If Radius > 0 Then
  10. Else
  11. MsgBox "Bitte nur positive aen eingeben.", vbcritical, "Fehler"
  12. End If
  13. Umfang = 2 * Pi * Radius
  14. Flaeche = Pi * Radius * Radius
  15. MsgBox "Umfang:" & Umfang & vbCrlf & "Fläche:" & Flaeche, vbInformation, "Ergebnis"