simonradev

CorDraw

Jun 30th, 2017
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.61 KB | None | 0 0
  1. namespace DrawingTool
  2. {
  3.     using System;
  4.  
  5.     public class CorDraw
  6.     {
  7.         public void Draw()
  8.         {
  9.             string figureType = Console.ReadLine();
  10.  
  11.             Figure figure = default(Figure);
  12.             int firstSide = int.Parse(Console.ReadLine());
  13.             if (figureType == "Square")
  14.             {
  15.                 figure = new Square(firstSide);
  16.             }
  17.             else
  18.             {
  19.                 int secondSide = int.Parse(Console.ReadLine());
  20.                 figure = new Rectangle(firstSide, secondSide);
  21.             }
  22.  
  23.             figure.Draw();
  24.         }
  25.     }
  26. }
Add Comment
Please, Sign In to add comment