Advertisement
Guest User

Untitled

a guest
Feb 19th, 2018
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.29 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 letfus_formen
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. //letfus philip
  14. //gruppe a
  15. //test
  16. //hoffentlich hängt mein visual studio nimmer
  17. string[] color = new string[3];
  18. color[0] = "255";
  19. color[1] = "255";
  20. color[2] = "255";
  21. Rechteck alo = new Rechteck(4, 5.5, color ); //dieses 4 und 5.5 sind x und y
  22. alo.a = 4; //a
  23. alo.b = 5.5; //b
  24. alo.BerechneUmfang(); //ausgabe
  25. alo.Zeichne();
  26. Radierer a = new Radierer();
  27. a.Radieren(ref alo);
  28. Console.ReadLine();
  29.  
  30.  
  31. }
  32. }
  33. }
  34. using System;
  35. using System.Collections.Generic;
  36. using System.Linq;
  37. using System.Text;
  38. using System.Threading.Tasks;
  39.  
  40. namespace letfus_formen
  41. {
  42. abstract class Form
  43. {
  44. public abstract void Zeichne();
  45. public string[] Color { get; private set; }
  46. public int x { get; private set; } //private set weil get public sein soll
  47. public int y { get; private set; }
  48. public Form(int x, int y, string[] color)
  49. {
  50. this.x = x;
  51. this.y = y;
  52. this.Color = color;
  53.  
  54. }
  55. public string getInfo()
  56. {
  57. string b = "Form an X:" + Convert.ToString(x) + " Form an Y: " + y + " RGB: " + Color[0] + Color[1] + Color[2];
  58. return b;
  59. }
  60. public abstract void BerechneUmfang();
  61.  
  62.  
  63.  
  64.  
  65. }
  66. }
  67. using System;
  68. using System.Collections.Generic;
  69. using System.Linq;
  70. using System.Text;
  71. using System.Threading.Tasks;
  72.  
  73. namespace letfus_formen
  74. {
  75. interface Rund
  76. {
  77. double Radius { get; set; }
  78. }
  79. }
  80. using System;
  81. using System.Collections.Generic;
  82. using System.Linq;
  83. using System.Text;
  84. using System.Threading.Tasks;
  85.  
  86. namespace letfus_formen
  87. {
  88. interface Eckig
  89. {
  90. uint Eckig { get; set; }
  91. }
  92. }
  93. using System;
  94. using System.Collections.Generic;
  95. using System.Linq;
  96. using System.Text;
  97. using System.Threading.Tasks;
  98.  
  99. namespace letfus_formen
  100. {
  101. class Rechteck : Form, Eckig
  102. {
  103. private int X;
  104. private double Y;
  105. private string[] color2;
  106. public Rechteck(int x, double y, string[] color):base(x, Convert.ToInt32(y), color)
  107. {
  108. X = this.x;
  109. Y = this.y;
  110. color2 = this.Color;
  111. }
  112.  
  113. uint Eckig.Eckig { get; set; }
  114. public int a;
  115. public double b;
  116.  
  117. override public void BerechneUmfang()
  118. {
  119. Console.WriteLine( 2*a + 2*b);
  120. }
  121. override public void Zeichne()
  122. {
  123. Console.WriteLine("Zeichne Rechteck in Farbe:" + Color[0] + Color[1] + Color[2]);
  124. }
  125.  
  126. }
  127. }
  128. using System;
  129. using System.Collections.Generic;
  130. using System.Linq;
  131. using System.Text;
  132. using System.Threading.Tasks;
  133.  
  134. namespace letfus_formen
  135. {
  136. class Radierer
  137. {
  138. public void Radieren(ref Rechteck a)
  139. {
  140. string b = a.getInfo();
  141. Console.WriteLine(b);
  142. a = null;
  143.  
  144.  
  145. }
  146. }
  147. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement