Advertisement
Guest User

zad9

a guest
May 23rd, 2018
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.11 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4.  
  5. namespace zaadanie9
  6. {
  7. class Punkt
  8. {
  9. float x, y;
  10. Punkt()
  11. {
  12. x =
  13. y=
  14.  
  15.  
  16. }
  17. void przesun ( float x, float y)
  18. {
  19. this.x += x;
  20. this.y += y;
  21. }
  22.  
  23. }
  24. class Figura : Punkt
  25. {
  26. protected Punkt Srodek;
  27. Figura()
  28. {
  29. Srodek = new Punkt;
  30.  
  31. }
  32. Figura(Punkt p)
  33. {
  34. Srodek = p;
  35. }
  36. float Pole();
  37. float Obwod();
  38. float Skaluj();
  39. void move ( float x, float y)
  40. {
  41.  
  42. }
  43. }
  44. class Kolo : Figura
  45. {
  46. float r;
  47. Kolo()
  48. {
  49. r=
  50.  
  51. }
  52. Kolo(Punkt p, float rr)
  53. {
  54.  
  55. r = rr;
  56. }
  57. float Pole()
  58. {
  59. return (float)Math.PI * (float)Math.Pow(r, 2);
  60. }
  61. float Obwod()
  62. {
  63. return 2 * (float)Math.PI * r;
  64. }
  65. void Skaluj()
  66. {
  67.  
  68. }
  69. }
  70. class Kwadrat : Figura
  71. {
  72. float dlugosc;
  73. Kwadrat()
  74. {
  75. dlugosc =
  76. }
  77. Kwadrat(Punkt p, float a)
  78. {
  79. dlugosc = a;
  80. }
  81. float Pole()
  82. {
  83. return (float)Math.Pow(dlugosc, 2);
  84. }
  85. float Obwod()
  86. {
  87. return 4 * dlugosc;
  88. }
  89. void Skaluj()
  90. {
  91.  
  92. }
  93. }
  94. class Program
  95. {
  96. static void Main(string[] args)
  97. {
  98. List<Figura> lista = new List<Figura>();
  99. float sumaObwodow=0;
  100. float sumaPol=0;
  101. for( int i=0;i<6;i++)
  102. {
  103. if( i%2==0)
  104.  
  105. else
  106.  
  107. }
  108. Console.WriteLine("Wartosci pol wynkoszÄ…: ");
  109.  
  110.  
  111.  
  112.  
  113. Console.WriteLine("Suma wszystkich pol=");
  114.  
  115.  
  116. Console.WriteLine("Suma wszytskich obwodow=");
  117. }
  118. }
  119. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement