Visit our site: Vist and Get Free Gifts

Learn To Build: Rectangleapplication: it returns the lenght and width

Visit our site: Vist and Get Free Gifts

Visit our site: Vist and Get Free Gifts

Tuesday, February 4, 2014

Rectangleapplication: it returns the lenght and width

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Rectangleapplication
{
    class Rectangle
    {
        double length;
        double width;
        public void AcceptDetails()
        {
            length = 4.6;
            width = 3.8;
        }
        public double GetArea()
        {
            return width * length;
        }
        public void DisPlay()
        {
            Console.WriteLine("length: {0}", length);
            Console.WriteLine("Width : {0}", width);
            Console.WriteLine("Area:{0}", GetArea());
        }
    }

    class ExcuteTactangle
    {
        static void Main(string[] args)
        {
           Rectangle p = new Rectangle();
            p.AcceptDetails();
            p.DisPlay();
            p.GetArea();
            Console.ReadLine();


        }
    }
}

Labels: ,

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home