Beispiel #1
0
        static void Main(string[] args)
        {
            Sphere ball = new Sphere(2, 50);
            var    vol  = ball.GetVolume();
            var    sur  = ball.GetSurfaceArea();
            var    p    = ball.GetDensity();

            Console.WriteLine($"Volume = {vol}; Surface = {sur}; Density = {p}.");
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            Sphere ball = new Sphere(2, 50);

            Console.WriteLine(ball.GetRadius());
            Console.WriteLine(ball.GetMass());
            Console.WriteLine(ball.GetVolume());
            Console.WriteLine(ball.GetSurfaceArea());
            Console.WriteLine(ball.GetDensity());
            Console.ReadLine();
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            Sphere sp     = new Sphere(2, 50);
            int    radius = sp.GetRadius();

            Console.WriteLine(radius);
            int mass = sp.GetMass();

            Console.WriteLine(mass);
            decimal density = sp.GetDensity();

            Math.Round(density, 5);
            Console.WriteLine(density);
            decimal volume = sp.GetVolume();

            Math.Round(volume, 5);
            Console.WriteLine(volume);
            decimal result = sp.SurfaceArea();

            Math.Round(result, 5);
            Console.WriteLine(result);
        }