Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. using System;
  2.  
  3. namespace WorkingWithClasses
  4. {
  5. class MainClass
  6. {
  7.  
  8.  
  9. public static void Main(string[] args)
  10. {
  11.  
  12.  
  13. Car myNewCar = new Car();
  14. myNewCar.Model = "M3";
  15. myNewCar.Make = "BMW";
  16. myNewCar.Value = "20,000";
  17.  
  18. PrintCar(myNewCar);
  19. }
  20.  
  21. public static void PrintCar(Car _car)
  22. {
  23. Console.WriteLine("{0} {1} {2}", _car.Make, _car.Model, _car.Value);
  24. }
  25.  
  26. }
  27. public class Car
  28. {
  29. public string Model { get; set; }
  30. public string Make { get; set; }
  31. public string Value { get; set; }
  32.  
  33. }
  34.  
  35.  
  36.  
  37.  
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement