## Practice Exercises C# Sharp

Learn to program performing exercises with C# Sharp

## 12 Lessons C# Sharp with the Solutions - 228 Exercises C# Sharp with the solutions For Beginners, Intermediates and Advanceds

The human knowledge belongs to the world
¡The infomation should be free!

5 Estrellas - 9986Total Votos

# 3D point - Practice Exercises C# Sharp

## Source Code:

```using System;
class Point3D
{
protected double x, y, z;

public Point3D()
{
}

public Point3D(double nx, double ny, double nz)
{
MoveTo(nx, ny, nz);
}

public double GetX()
{
return x;
}

public void SetX(double value)
{
x = value;
}

public double GetY()
{
return y;
}

public void SetY(double value)
{
y = value;
}

public double GetZ()
{
return z;
}

public void SetZ(double value)
{
z = value;
}

public void MoveTo(double nx, double ny, double nz)
{
x = nx;
y = ny;
z = nz;
}

public double DistanceTo(Point3D p2)
{
return Math.Sqrt((x - p2.GetX()) * (x - p2.GetX()) +
(y - p2.GetY()) * (y - p2.GetY()) +
(z - p2.GetZ()) * (z - p2.GetZ()));
}
}

```
Exercisey 7.12