using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ch7_7
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Circle c = new Circle();
            double r, x, y;
            r = Convert.ToDouble(textBox1.Text);
            ISample obj1 = new Circle(r);
            Result.Text = "Circle area is : ";
            Result.Text += (obj1.calculateArea()).ToString();
            Result.Text += "\n";
            x = Convert.ToDouble(textBox2.Text);
            y = Convert.ToDouble(textBox3.Text);
            Rectangle rect = new Rectangle();
            ISample obj2 = new Rectangle(x, y);
            Result.Text += "Rectangle area is : ";
            Result.Text += (obj2.calculateArea()).ToString();
        }
    }
}
