static void Main() { DistanceCalculatorClient dcc = new DistanceCalculatorClient(); double distance = dcc.CalcDistance(10, 10, 15, 15); Console.WriteLine(distance); }
public static void Main() { var calc = new DistanceCalculatorClient(); var result = calc.CalculateDistance( new Point() { X = 5, Y = 10 }, new Point() { X = 10, Y = 15 }); Console.WriteLine(result); }
static void Main(string[] args) { Point a = new Point(){X = 3, Y = 5}; Point b = new Point(){X = 10,Y = 2}; DistanceCalculatorClient c = new DistanceCalculatorClient(); var result = c.CalculateDistance(a, b); Console.WriteLine(result); }
static void Main() { var calculator = new DistanceCalculatorClient(); var result = calculator.CalcDistance( new Point() {X = 5, Y = 7}, new Point() {X = 8, Y = 10} ); Console.WriteLine("Distance between the two points {0:F2}", result); }
public static void Main() { DistanceCalculatorClient client = new DistanceCalculatorClient(); double result1 = client.CalcDistance( new Point { X = 0, Y = 0 }, new Point { X = 2, Y = 2 }); Console.WriteLine(result1); double result2 = client.CalcDistance( new Point { X = 3, Y = 4 }, new Point { X = -3, Y = -5 }); Console.WriteLine(result2); }
static void Main(string[] args) { Point a = new Point() { X = 3, Y = 5 }; Point b = new Point() { X = 10, Y = 2 }; DistanceCalculatorClient c = new DistanceCalculatorClient(); var result = c.CalculateDistance(a, b); Console.WriteLine(result); }
public static void Main() { int startX = int.Parse(Console.ReadLine()); int startY = int.Parse(Console.ReadLine()); int endX = int.Parse(Console.ReadLine()); int endY = int.Parse(Console.ReadLine()); DistanceCalculatorClient distanceCalculator = new DistanceCalculatorClient(); var startPoint = new Point() { X = startX, Y = startY }; var endPoint = new Point() { X = endX, Y = endY }; var distance = distanceCalculator.CalculateDistance(startPoint, endPoint); Console.WriteLine(distance); }
public static void Main() { var calc = new DistanceCalculatorClient(); var result = calc.CalcDistance(new Point { X = 1, Y = 1 }, new Point { X = 3, Y = 3 }); Console.WriteLine(result); using (var webClient = new WebClient()) { var res = webClient.DownloadString("http://localhost:32705/api/Calculator?ax=1&ay=1&bx=3&by=3"); Console.WriteLine(res); } }
static void Main() { DistanceCalculatorClient calculator = new DistanceCalculatorClient(); Point startPoint = new Point() { X = 5, Y = 4 }; Point endPoint = new Point() { X = 10, Y = 30 }; double result = calculator.CalculateDistance(startPoint, endPoint); Console.WriteLine(result); }
static void Main() { Console.Write("Please enter the X value of the starting point: "); int startX = int.Parse(Console.ReadLine()); Console.Write("Please enter the Y value of the starting point: "); int startY = int.Parse(Console.ReadLine()); Console.Write("Please enter the X value of the ending point: "); int endX = int.Parse(Console.ReadLine()); Console.Write("Please enter the Y value of the ending point: "); int endY = int.Parse(Console.ReadLine()); using (var calc = new DistanceCalculatorClient()) { var result = calc.CalcDistance( new Point() { X = startX, Y = startY }, new Point() { X = endX, Y = endY } ); Console.WriteLine("The distance between point A({0}, {1}) and point B({2}, {3}) is: {4:F2} units", startX, startY, endX, endY, result); } }