using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace TestShapes__containing { class Program { static void Main() { DrawShapes square = new DrawShapes(); DrawShapes rectangle = new DrawShapes(); DrawShapes triangle = new DrawShapes(); //Console.Write("Enter Shape (S, R, T): "); //square.DrawSquare("S"); //rectangle.DrawRectangle("R"); //triangle.DrawTriangle("T"); } } public class DrawShapes { public void DrawSquare(int size) { Console.Write("Enter Size: "); size = Convert.ToInt32(Console.ReadLine()); for (int i = 0; i < size; i++) { Console.WriteLine(); for (int j = 0; j < size; j++) Console.Write("*"); } Console.WriteLine(); Console.WriteLine(); } public void DrawRectangle(int length, int width) { Console.Write("Enter Length: "); length = Convert.ToInt32(Console.ReadLine()); Console.Write("Enter Width: "); width = Convert.ToInt32(Console.ReadLine()); for (int i = 0; i < length; i++) { Console.WriteLine(); for (int j = 0; j < width; j++) Console.Write("*"); } Console.WriteLine(); Console.WriteLine(); } public void DrawTriangle(int size) { Console.Write("Enter Size: "); size = Convert.ToInt32(Console.ReadLine()); for (int i = 0; i < size; i++) { Console.WriteLine(); for (int j = 0; j < size; j++) { for (int l = j; l <= i; l++) Console.Write("*"); } } Console.WriteLine(); Console.WriteLine(); } } }