Mzsmunna
10/16/2019 - 1:50 PM

class Triangle


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication3
{
    class Triangle
    {
        private int x, y, z;

        public Triangle()
        {
            x = 0;
            y = 0;
            z = 0;

            System.Console.WriteLine("Enter Length : ");
            x = Int32.Parse(Console.ReadLine());

            System.Console.WriteLine("Enter Width : ");
            y = Int32.Parse(Console.ReadLine());

            System.Console.WriteLine("Enter Height : ");
            z = Int32.Parse(Console.ReadLine());
        }

        public void ShowInfo()
        {
            int r;
            r = x * y * z;
            Console.WriteLine("The Triangle is : " + r);
            
        }

        public void TestTriangle()
        {
            if ((x == y) && (y == z))
            {
                Console.WriteLine("The Triangle is Equilateral");
            }
            else if ((x == y) || (y == z) || (x == z))
            {
                Console.WriteLine("The Triangle is Isosceles");
            }
            else
            {
                Console.WriteLine("The Triangle is neither Equilateral nor Isosceles");
            }
        }

    }
}