示例#1
0
        public void CalculateVolume(int a, int b, int c, int expected)
        {
            var parallel = new Parallelepiped();

            parallel.a = a;
            parallel.b = b;
            parallel.c = c;
            var actual = parallel.CalculateVolume();

            Assert.AreEqual(expected, actual);
        }
        static void Main(string[] args)
        {
            try
            {
                var lenght = double.Parse(Console.ReadLine());
                var width  = double.Parse(Console.ReadLine());
                var height = double.Parse(Console.ReadLine());

                Parallelepiped parallelepiped = new Parallelepiped(lenght, width, height);

                var surfaceArea    = parallelepiped.CalculateSurface();
                var lateralSurface = parallelepiped.CalcualateLateralSurface();
                var volume         = parallelepiped.CalculateVolume();

                Console.WriteLine($"Surface Area - {surfaceArea:f2}");
                Console.WriteLine($"Lateral Surface Area - {lateralSurface:f2}");
                Console.WriteLine($"Volume - {volume:f2}");
            }
            catch (ArgumentException ex)
            {
                Console.WriteLine(ex.Message);
            }
        }