using System; using System.Collections.Generic; public class Program { public class Film { public string name; public string date; public string type; public string Name { get{return this.name;} set {this.name = value;} } public string Date { get{return this.date;} set {this.date = value;} } public string Type { get{return this.type;} set {this.type = value;} } public Film () { } public Film (string movie, string genre, string year) { name = movie; type = genre; date = year; } public override string ToString() { return "Movie: " + Name + ", " + "genre - " + Type + ", " + "date " + Type + " year"; } } public class Adding { public List movies = new List (); public List Movies { get{return this.movies;} set {this.movies = value;} } public void HowtoAdd (Film movie1) { Adding a2 = new Adding(); foreach(Film movie in a2.Movies) { movies.Add(movie1); } } public void Izvejdane(string command) { Adding a3 = new Adding(); foreach (Film movie3 in a3.Movies) { if (command == movie3.Name) { a3.HowtoAdd(movie3); } if (command == movie3.Type) { a3.HowtoAdd(movie3); } if (command == movie3.Date) { a3.HowtoAdd(movie3); } } foreach(Film element in a3.Movies) { string strx = element.ToString(); Console.WriteLine(strx); } } } public static void Main() { Adding a = new Adding(); for (int i = 0; i<1; i++) { Film a1= new Film(); Console.Write("Movie:"); a1.Name = Console.ReadLine(); Console.Write("Movie genre:"); a1.Type = Console.ReadLine(); Console.Write("Date:"); a1.Date = Console.ReadLine(); a.HowtoAdd(a1); } Console.WriteLine("Command:"); string command1 = Console.ReadLine(); a.Izvejdane(command1); } }