Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -------------------------------------------------------------------------------------------------Adam------------------------------------------------------------------------------
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Kompozice
- {
- class Dvere
- {
- public string material { get; set; }
- public string barva { get; set; }
- public Okno okno { get; set; }
- public Dvere(string material, string barva, Okno okno)
- {
- this.material = material;
- this.barva = barva;
- this.okno = okno;
- }
- }
- class Okno
- {
- public bool tonovani { get; set; }
- public Okno(bool tonovani)
- {
- this.tonovani = tonovani;
- }
- }
- class Program
- {
- static void Main(string[] args)
- {
- Okno okno = new Okno(true);
- Dvere dvere = new Dvere("Plast", "Zelená", okno);
- }
- }
- }
- -------------------------------------------------------------------------------------------------Marian------------------------------------------------------------------------------
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Kompozice_soucastky
- {
- class Karoserie
- {
- public string barva { get; set; }
- public Dvere dvere { get; set; }
- public Karoserie(string barva, Dvere dvere)
- {
- this.barva = barva;
- this.dvere = dvere;
- }
- }
- class Dvere
- {
- public Okno okno { get; set; }
- public Dvere(Okno okno)
- {
- this.okno = okno;
- }
- }
- class Okno
- {
- public string material { get; set; }
- public string velikost { get; set; }
- public Okno(string material, string velikost)
- {
- this.material = material;
- this.velikost = velikost;
- }
- }
- class Program
- {
- static void Main(string[] args)
- {
- Okno oknenko = new Okno("upecenypisek", "12");
- Dvere vrata = new Dvere(okenko);
- Karoserie karca = new Karoserie("modrá", vrata);
- }
- }
- }
- ///////////////////////////////////////////////////////////////////////////////
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApplication10
- {
- class Motor
- {
- public int Objem { get; set; }
- public string Typ { get; set; }
- public Motor(int objem, string typ)
- {
- Objem = objem;
- Typ = typ;
- }
- }
- class Prevodovka
- {
- public string Vyrobce { get; set; }
- public string Typ { get; set; }
- public Prevodovka(string vyrobce, string typ)
- {
- Vyrobce = vyrobce;
- Typ = typ;
- }
- }
- class Auto
- {
- public Motor MotorAuta { get; set; }
- public Prevodovka PrevodovkaAuta { get; set; }
- public Auto(Motor mot, Prevodovka prev)
- {
- MotorAuta = mot;
- PrevodovkaAuta = prev;
- }
- }
- class Program
- {
- static void Main(string[] args)
- {
- Motor mot = new Motor(4999, "Benzin");
- Prevodovka prev = new Prevodovka("Bosch","Automat");
- Auto auto = new Auto(mot, prev);
- Console.WriteLine(auto.MotorAuta.Objem);
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement