Person.cs 662 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. namespace ClassLibrary1;
  2. public class Place
  3. {
  4. public string Name { get; set; }
  5. public int Price { get; set; }
  6. public Place(string name, int price)
  7. {
  8. Name = name;
  9. Price = price;
  10. }
  11. public void Display()
  12. {
  13. Console.WriteLine($"{Name} - ${Price}");
  14. }
  15. }
  16. public class Workers
  17. {
  18. public string Name { get; set; }
  19. public Workers(string name)
  20. {
  21. Name = name;
  22. }
  23. public void Order(List<Place> places)
  24. {
  25. Console.WriteLine($"{Name} проводит экскурсию в: ");
  26. foreach (var place in places)
  27. {
  28. place.Display();
  29. }
  30. }
  31. }