Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2020
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace ConsoleApplication1
  7. {
  8. class Program
  9. {
  10. static void Main(string[] args)
  11. {
  12. Random rnd = new Random();
  13. double a = rnd.Next(-10, 10), b = rnd.Next(-10, 10), c = rnd.Next(-10, 10), d = rnd.Next(-10, 10);
  14. Point n = new Point(a, b);
  15. Point n = new Point(c, d);
  16. }
  17. }
  18. }
  19.  
  20. class Point
  21. {
  22. private double x;
  23. private double y;
  24.  
  25. public Point(double x, double y)
  26. {
  27. this.x = x;
  28. this.y = y;
  29. }
  30.  
  31. public void SetCord(double x , double y)
  32. {
  33. this.x = x;
  34. this.y = y;
  35. }
  36.  
  37. public string GetCord()
  38. {
  39. return "x = " + this.x + "y = " + this.y;
  40. }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement