Advertisement
Guest User

Untitled

a guest
Dec 8th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. class Samochod
  2. {
  3. private string Marka { get; set; }
  4. private string Model { get; set; }
  5. private string Silnik { get; set; }
  6. private double Pojemnosc { get; set; }
  7.  
  8. public Samochod()
  9. {
  10.  
  11. }
  12.  
  13. public void Dodaj()
  14. {
  15. Console.WriteLine("Marka: ");
  16. string marka = Console.ReadLine();
  17. Console.WriteLine("Model: ");
  18. string model = Console.ReadLine();
  19. Console.WriteLine("Silnik: ");
  20. string silnik = Console.ReadLine();
  21. Console.WriteLine("Pojemnosc: ");
  22. double pojemnosc = Convert.ToDouble(Console.ReadLine());
  23.  
  24.  
  25. Marka = marka;
  26. Model = model;
  27. Silnik = silnik;
  28. Pojemnosc = pojemnosc;
  29.  
  30. }
  31.  
  32. public void Pokaz()
  33. {
  34. Console.WriteLine("Marka: " + Marka + " Model: " + Model);
  35. Console.WriteLine("Silnik i pojemnosc: " + Silnik + Pojemnosc);
  36.  
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement