Ejemplo n.º 1
0
        public static Parallelepiped SetParallelepiped(out string name, out string type, out double a, out double b,
                                                       out double h, out double area, out double volume, out int tops, out int edges, out int sides)
        {
            Console.Write("Set Name of Parallelepiped: ");
            name = Console.ReadLine();

            Console.Write("Set Type of Parallelepiped: ");
            type = Console.ReadLine();

            Console.Write("Enter two sides of parallelepiped base and height:\n");
            Console.Write("a: ");
            a = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture);
            Console.Write("b: ");
            b = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture);
            Console.Write("h: ");
            h = double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture);

            Parallelepiped parallelepiped = new Parallelepiped(a, b, h);

            parallelepiped.Name = name;
            parallelepiped.Type = type;
            area   = parallelepiped.Area();
            volume = parallelepiped.Volume();
            tops   = parallelepiped.QuantityOfTops();
            edges  = parallelepiped.QuantityOfEdges();
            sides  = parallelepiped.QuantityOfSides();

            parallelepiped.Areaa   = area;
            parallelepiped.Volumee = volume;

            return(parallelepiped);
        }
        public void AreaTestMethod()
        {
            Parallelepiped figure   = new Parallelepiped(Colour.White, Colour.Yellow, 0.1, 1, 1, 1);
            double         expected = 6;
            double         actual   = figure.Area();

            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 3
0
        private void button1_Click(object sender, EventArgs e)
        {
            Parallelepiped Parallelepiped1 = new Parallelepiped();

            Parallelepiped1.a = int.Parse(textBox1.Text);
            Parallelepiped1.b = int.Parse(textBox9.Text);
            Parallelepiped1.c = int.Parse(textBox11.Text);
            textBox12.Text    = Parallelepiped1.V().ToString();
            textBox13.Text    = Parallelepiped1.Area().ToString();

            Elipsoid Elipsoid1 = new Elipsoid();

            Elipsoid1.a    = int.Parse(textBox4.Text);
            Elipsoid1.b    = int.Parse(textBox10.Text);
            Elipsoid1.c    = int.Parse(textBox6.Text);
            textBox14.Text = Elipsoid1.V().ToString();
            textBox15.Text = Elipsoid1.Area().ToString();
        }