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();
}
}
}
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();
}
}
}
0 comments:
Post a Comment