using System; using System.Collections.Generic; namespace Dotmyself { /// /// It computes the area covered by all the shapes /// Author : Hyacinthe MENIET /// class Program { static void Main(string[] args) { List shapes = new List { new Triangle("T1",2.5), new Square("S1",4.75), new Triangle("T2",1.66), new Circle("C1",3.25) }; double total = 0; shapes.ForEach( s => { Console.WriteLine("The individual area of {0} is {1} units", s.Name, s.Area()); total += s.Area(); }); Console.WriteLine("The shapes in this drawing cover an area of {0} units.", total); Console.ReadLine(); } } }