Advertisement
Guest User

Untitled

a guest
Mar 25th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApplication1
  8. {
  9. public class Circle
  10. {
  11. double x;
  12. double y;
  13. double R;
  14. string color;
  15. public Circle(double a, double b, double c, string d)
  16. {
  17. x = a;
  18. y = b;
  19. R = c;
  20. color = d;
  21. }
  22. public double Area()
  23. {
  24. return 2 * Math.PI * R;
  25. }
  26. public void Move(double a, double b)
  27. {
  28. x = a;
  29. y = b;
  30. }
  31. public void Printinfo()
  32. {
  33. Console.WriteLine("x = " + x + "\ny = " + y + "\nR = " + R);
  34. }
  35. }
  36. class Program
  37. {
  38. void Main()
  39. {
  40. double a, b, c;
  41. string d;
  42. Circle[] data = new Circle[5];
  43. for(int i = 0; i < 2; i++)
  44. {
  45. Console.Write("x = ");
  46. a = Convert.ToDouble(Console.Read());
  47. Console.Write("y = ");
  48. b = Convert.ToDouble(Console.Read());
  49. Console.Write("R = ");
  50. c = Convert.ToDouble(Console.Read());
  51. Console.Write("color = ");
  52. d = Convert.ToString(Console.Read());
  53. data[i] = new Circle(a, b, c, d);
  54. }
  55. Print(data);
  56. }
  57. void Print(Circle[] data)
  58. {
  59. foreach (Circle fd in data)
  60. {
  61. fd.Printinfo();
  62. }
  63. }
  64.  
  65. }
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement