Added exercices
This commit is contained in:
1 parent
eed3373822
commit
e8ccd877a0
3 files changed
+69
-16
No files matched your search
@@ -0,0 +1,29 @@
|
||||
namespace Algorithms;
|
||||
using System;
|
||||
class Point
|
||||
{
|
||||
private double x;
|
||||
private double y;
|
||||
|
||||
public Point(double x, double y)
|
||||
{
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
public double X()
|
||||
{
|
||||
return x;
|
||||
}
|
||||
|
||||
public double Y()
|
||||
{
|
||||
return y;
|
||||
}
|
||||
|
||||
public double Distance()
|
||||
{
|
||||
return Math.Sqrt(X() * X() + Y() * Y());
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user