Exemplo n.º 1
0
        public static void Main()
        {
            // throw ArgumentException
            // Console.WriteLine(GetFileName.GetFileExtension("example"));
            Console.WriteLine(GetFileName.GetFileExtension("example.pdf"));
            Console.WriteLine(GetFileName.GetFileExtension("example.new.pdf"));

            // throw ArgumentException
            // Console.WriteLine(GetFileName.GetFileNameWithoutExtension("example"));
            Console.WriteLine(GetFileName.GetFileNameWithoutExtension("example.pdf"));
            Console.WriteLine(GetFileName.GetFileNameWithoutExtension("example.new.pdf"));

            Console.WriteLine(
                "Distance in the 2D space = {0:f2}",
                DistanceCalculations.CalculateDistance2D(1, -2, 3, 4));
            Console.WriteLine(
                "Distance in the 3D space = {0:f2}",
                DistanceCalculations.CalculateDistance3D(5, 2, -1, 3, -6, 4));

            var parallelepiped = new Parallelepiped(3, 4, 5);

            Console.WriteLine("Volume = {0:f2}", parallelepiped.CalculateVolume());
            Console.WriteLine("Diagonal XYZ = {0:f2}", parallelepiped.CalculateDiagonalXYZ());
            Console.WriteLine("Diagonal XY = {0:f2}",    parallelepiped.CalculateDiagonalXY());
            Console.WriteLine("Diagonal XZ = {0:f2}", parallelepiped.CalculateDiagonalXZ());
            Console.WriteLine("Diagonal YZ = {0:f2}", parallelepiped.CalculateDiagonalYZ());
            Console.Read();
        }
Exemplo n.º 2
0
        public static void Main()
        {
            string firstFileExtension = File.GetFileExtension("example");
            Console.WriteLine(firstFileExtension);

            string secondFileExtension = File.GetFileExtension("example.pdf");
            Console.WriteLine(secondFileExtension);

            string thirdFileExtension = File.GetFileExtension("example.new.pdf");
            Console.WriteLine(thirdFileExtension);

            string firstFileName = File.GetFileNameWithoutExtension("example");
            Console.WriteLine(firstFileName);

            string secondFileName = File.GetFileNameWithoutExtension("example.pdf");
            Console.WriteLine(secondFileName);

            string thirdFileName = File.GetFileNameWithoutExtension("example.new.pdf");
            Console.WriteLine(thirdFileName);

            double distanceBetweenPoints2D = Geometry.CalculateDistance2D(1, -2, 3, 4);
            Console.WriteLine(DistancePrintMessage, "2D", distanceBetweenPoints2D);

            double distanceBetweenPoints3D = Geometry.CalculateDistance3D(5, 2, -1, 3, -6, 4);
            Console.WriteLine(DistancePrintMessage, "3D", distanceBetweenPoints3D);

            Parallelepiped figure = new Parallelepiped(3, 4, 5);

            double figureVolume = figure.CalculateVolume();
            Console.WriteLine("Volume = {0:f2}", figureVolume);

            double figureDiagonalXYZ = figure.CalculateDiagonalXYZ();
            Console.WriteLine("Diagonal XYZ = {0:f2}", figureDiagonalXYZ);

            double figureDiagonalXY = figure.CalculateDiagonalXY();
            Console.WriteLine("Diagonal XY = {0:f2}", figureDiagonalXY);

            double figureDiagonalXZ = figure.CalculateDiagonalXZ();
            Console.WriteLine("Diagonal XZ = {0:f2}", figureDiagonalXZ);

            double figureDiagonalYZ = figure.CalculateDiagonalYZ();
            Console.WriteLine("Diagonal YZ = {0:f2}", figureDiagonalYZ);
        }
        static void Main()
        {
            Console.WriteLine(FileUtils.GetFileExtension("example"));
            Console.WriteLine(FileUtils.GetFileExtension("example.pdf"));
            Console.WriteLine(FileUtils.GetFileExtension("example.new.pdf"));

            Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example"));
            Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.pdf"));
            Console.WriteLine(FileUtils.GetFileNameWithoutExtension("example.new.pdf"));

            Console.WriteLine(
                "Distance in the 2D space = {0:f2}",
                DistanceUtils.CalculateDistance2D(1, -2, 3, 4));
            Console.WriteLine(
                "Distance in the 3D space = {0:f2}",
                DistanceUtils.CalculateDistance3D(5, 2, -1, 3, -6, 4));

            Parallelepiped parallelepiped = new Parallelepiped(1.0, 2.0, 3.0);
            Console.WriteLine("Volume = {0:f2}", parallelepiped.CalculateVolume());
            Console.WriteLine("Diagonal XYZ = {0:f2}", parallelepiped.CalculateDiagonalXYZ());
            Console.WriteLine("Diagonal XY = {0:f2}", parallelepiped.CalculateDiagonalXY());
            Console.WriteLine("Diagonal XZ = {0:f2}", parallelepiped.CalculateDiagonalXZ());
            Console.WriteLine("Diagonal YZ = {0:f2}", parallelepiped.CalculateDiagonalYZ());
        }