123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- namespace ClassLibrary1;
- using System.Reflection;
- public class Category
- {
- public string title { get; set; }
- public Category(string Title)
- {
- title = Title;
- }
- public void Display()
- {
- Console.WriteLine($"Это путешествие {title}");
- }
- }
- public class Place
- {
- public string Name { get; set; }
- public int Price { get; set; }
- public Category category { get; set; }
- public Place(string name, int price)
- {
- Name = name;
- Price = price;
- }
- public void Display()
- {
- Console.WriteLine($"{Name} - ${Price}");
- }
- }
- public class Client
- {
- public string Name { get; set; }
- public Client (string name)
- {
- Name=name;
- }
- public void Order(List<Place> places)
- {
- Console.WriteLine($"{Name} выбрал путешествие в: ");
- foreach (var place in places)
- {
- place.Display();
- }
- }
- }
|