Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace letfus_formen
- {
- class Program
- {
- static void Main(string[] args)
- {
- //letfus philip
- //gruppe a
- //test
- //hoffentlich hängt mein visual studio nimmer
- string[] color = new string[3];
- color[0] = "255";
- color[1] = "255";
- color[2] = "255";
- Rechteck alo = new Rechteck(4, 5.5, color ); //dieses 4 und 5.5 sind x und y
- alo.a = 4; //a
- alo.b = 5.5; //b
- alo.BerechneUmfang(); //ausgabe
- alo.Zeichne();
- Radierer a = new Radierer();
- a.Radieren(ref alo);
- Console.ReadLine();
- }
- }
- }
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace letfus_formen
- {
- abstract class Form
- {
- public abstract void Zeichne();
- public string[] Color { get; private set; }
- public int x { get; private set; } //private set weil get public sein soll
- public int y { get; private set; }
- public Form(int x, int y, string[] color)
- {
- this.x = x;
- this.y = y;
- this.Color = color;
- }
- public string getInfo()
- {
- string b = "Form an X:" + Convert.ToString(x) + " Form an Y: " + y + " RGB: " + Color[0] + Color[1] + Color[2];
- return b;
- }
- public abstract void BerechneUmfang();
- }
- }
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace letfus_formen
- {
- interface Rund
- {
- double Radius { get; set; }
- }
- }
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace letfus_formen
- {
- interface Eckig
- {
- uint Eckig { get; set; }
- }
- }
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace letfus_formen
- {
- class Rechteck : Form, Eckig
- {
- private int X;
- private double Y;
- private string[] color2;
- public Rechteck(int x, double y, string[] color):base(x, Convert.ToInt32(y), color)
- {
- X = this.x;
- Y = this.y;
- color2 = this.Color;
- }
- uint Eckig.Eckig { get; set; }
- public int a;
- public double b;
- override public void BerechneUmfang()
- {
- Console.WriteLine( 2*a + 2*b);
- }
- override public void Zeichne()
- {
- Console.WriteLine("Zeichne Rechteck in Farbe:" + Color[0] + Color[1] + Color[2]);
- }
- }
- }
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace letfus_formen
- {
- class Radierer
- {
- public void Radieren(ref Rechteck a)
- {
- string b = a.getInfo();
- Console.WriteLine(b);
- a = null;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement