Exercise
Sphere, float
Objetive
Write a Visual Basic (VB.Net) program that calculate the surface area and volume of a sphere, given its radius (surface area = 4 * pi * radius squared; volume = 4/3 * pi * radius cubed).
Note: For floating-point numbers, you should use Convert.ToSingle(...)
Code
Imports System
Public Class exercise59
Public Shared Sub Main()
Dim radius As Single
Dim pi As Single = 3.1415926535F
Console.Write("Radius? ")
radius = Convert.ToSingle(Console.ReadLine())
Console.WriteLine(4 * pi * (radius * radius))
Console.WriteLine(4 / 3 * pi * (radius * radius * radius))
End Sub
End Class