Forums » .NET » ASP.NET »

# How to Create Measurment application for rectanle,square etc using c#.net

Posted Date: 20 Feb 2012      Posted By:: vijay     Member Level: Gold    Member Rank: 1753     Points: 2   Responses: 2

Hai,
How to Create Measurment application for rectanle,square,circle angle and other measurements using c#.net can any tell me any site or code..

# Responses

 #658133    Author: PalaniKumar.A      Member Level: Gold      Member Rank: 265     Date: 20/Feb/2012   Rating:     Points: 4 hi,Sample code for rectangle,square,circle to find area..It will help to develop application..`class Area{ public Area(double x, double y) { double res = .5 * x * y; Console.WriteLine("Area of triangle "+res); } public Area(int x, int y) { int res = x * y; Console.WriteLine("Area of Rectangle "+res); } static void Main(string[] args) { Area obj = new Area(20.50, 50.10); obj = new Area(10,10); Console.ReadLine(); }}`For Circle:`radius = input ("Please Enter The Radius Of The Circle")area = int(radius)**2*3.14print ("The area of the circle with radius", radius, "is", area)`To Find area of polygon :`public class Area{ public static double AreaPolygon(int[] x, int[] y, int noOfPoints) { double area = 0; for (int i = 0; i < noOfPoints; i++) { area = area + ((x[i] * y[i+1]) - (x[i + 1] * y[i])) } area = area * 0.5; return area; } public static double AreaTriangle(int b, int h) { return (b * h) * 0.5; } public static double AreaRectangle(int l, int h) { return (l * h); }}`Palanikumar.A\$-Success is often the result of taking a misstep in the right direction-\$

 #658179    Author: Asheej T K        Member Level: Diamond      Member Rank: 2     Date: 20/Feb/2012   Rating:     Points: 2 Hi,What you wanted to measure and how you wanted to measure? Please explain your requirement properly. If it is calculating the area then it is just a mathematical calculation.Regards,Asheej T KMicrosoft MVP[ASP.NET/IIS]DotNetSpider MVM