Example #1
0
        static void Main(string[] args)
        {
            try
            {
                double a = double.Parse(Console.ReadLine());
                double b = double.Parse(Console.ReadLine());
                double c = double.Parse(Console.ReadLine());
                Console.WriteLine("3");
                var box = new Box(a, c, b);

                box.CalcSurfaceArea();
                box.LateralSurfaceArea();
                box.CalcVolume();
            }
            catch (System.Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
Example #2
0
        static void Main(string[] args)
        {
            Type boxType = typeof(Box);

            FieldInfo[] fields = boxType.GetFields(BindingFlags.NonPublic | BindingFlags.Instance);
            Console.WriteLine(fields.Count());

            //double length = double.Parse(Console.ReadLine());
            double[] input = new double[3];
            input[0] = double.Parse(Console.ReadLine());
            input[1] = double.Parse(Console.ReadLine());
            input[2] = double.Parse(Console.ReadLine());
            Box box = new Box(input[0], input[1], input[2]);

            Console.WriteLine("Surface Area - {0:f2}\nLateral Surface Area - {1:f2}\nVolume - {2:f2}", box.SurfaceArea(), box.LateralSurfaceArea(), box.Volume());
        }
Example #3
0
        static void Main(string[] args)
        {
            try
            {
                double a = double.Parse(Console.ReadLine());
                double b = double.Parse(Console.ReadLine());
                double c = double.Parse(Console.ReadLine());
                Console.WriteLine("3");
                var box = new Box(a, c, b);

                box.CalcSurfaceArea();
                box.LateralSurfaceArea();
                box.CalcVolume();
            }
            catch (System.Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }