Exemplo n.º 1
0
    static void Main(string[] args)
    {
        double length = double.Parse(Console.ReadLine());
        double width  = double.Parse(Console.ReadLine());
        double height = double.Parse(Console.ReadLine());

        box box = new box(length, width, height);

        Console.WriteLine(box.Getarea());
        Console.WriteLine(box.GetLaterArea());
        Console.WriteLine(box.GetVolume());
    }
Exemplo n.º 2
0
    static void Main(string[] args)
    {
        double length = double.Parse(Console.ReadLine());
        double width  = double.Parse(Console.ReadLine());
        double height = double.Parse(Console.ReadLine());

        try
        {
            box box = new box(length, width, height);

            Console.WriteLine(box.GetArea());
            Console.WriteLine(box.GetLaterArea());
            Console.WriteLine(box.GetVolume());
        }
        catch (ArgumentException ex)
        {
            Console.WriteLine(ex.Message);
        }
    }