Переделать программу с помощью классов - C#
Формулировка задачи:
Написал программу, но ее нужно сделать с помощью классов, помогите пожалуйста.
class Program
{
static void Main(string[] args)
{
Console.Write("x1=");
int x1 = int.Parse(Console.ReadLine());
Console.Write("y1=");
int y1 = int.Parse(Console.ReadLine());
Console.Write("x2=");
int x2 = int.Parse(Console.ReadLine());
Console.Write("y2=");
int y2 = int.Parse(Console.ReadLine());
Console.Write("x3=");
int x3 = int.Parse(Console.ReadLine());
Console.Write("y3=");
int y3 = int.Parse(Console.ReadLine());
double a;
a = Math.Sqrt((x2 - x1) ^ 2 + (y2 - y1) ^ 2);
double b;
b = Math.Sqrt((x3 - x1) ^ 2 + (y3 - y1) ^ 2);
double c;
c = Math.Sqrt((x3 - x2) ^ 2 + (y3 - y2) ^ 2);
double d;
d = a + b + c;
Console.Write("Периметр треугольника равен: ");
Console.WriteLine("{0:F2}+{1:F2}+{2:F2}={3:F2}", a, b, c, d);
Console.ReadLine();
}
}
}Решение задачи: «Переделать программу с помощью классов»
textual
Листинг программы
public class Triangle{
Point A;
Point B;
Point C;
public Triangle(Point a, Point b, Point c){
this.A = a;
this.B = b;
this.C = c;
}
public double GetPerimetr(){
//тут расчетпериметра
}
}