Advertisement
BojidarDosev

zad 2

Nov 26th, 2021
835
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.98 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ConsoleApp18
  4. {
  5.     class Program
  6.     {
  7.        
  8.         static void Main(string[] args)
  9.         {
  10.             Car A1 = new Car("Audi","Black","EN6969KN");
  11.             A1.Danni();
  12.          
  13.         }
  14.     }
  15.     class Car
  16.     {
  17.         private string Brand;
  18.  
  19.         public string brand
  20.         {
  21.             get { return Brand; }
  22.             set { Brand = value; }
  23.         }
  24.         private string Color;
  25.  
  26.         public string color
  27.         {
  28.             get { return Color; }
  29.             set { Color = value; }
  30.         }
  31.         private string Id;
  32.      
  33.         public  string id
  34.         {
  35.             get { return Id; }
  36.             set { Id = value; }
  37.         }
  38.  
  39.         public Car(string brand, string color, string id)
  40.         {
  41.             this.brand = brand; this.color = color; this.id = id;
  42.         }
  43.         public void Danni()
  44.         {
  45.             Console.WriteLine(brand + " " + color + " " + id);
  46.         }
  47.  
  48.  
  49.     }
  50. }
  51.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement