} //{"Burgas", "Sofia", "Plovdiv", "Varna", "Ruse"} public void Randomizer(AdvertSlogan obj) { //AdvertSlogan obj = new AdvertSlogan(); int ph = obj.Phrases.Length; int ev = obj.Events.Length; int au = obj.Authors.Length; int ci = obj.Cities.Length; Random random = new Random(); Console.WriteLine("{0}, {1}, {2}, {3}", Phrases[random.Next(0, ph)], Events[random.Next(0, ev)], Authors[random.Next(0, au)], Cities[random.Next(0, ci)]); }
static void Main(string[] args) { int n = int.Parse(Console.ReadLine()); // number ofmessages to be generated AdvertSlogan advert = new AdvertSlogan(); string[] phrases = new string[] { "Excellent product.", "Such a great product.", "I always use that product.", "Best product of its category.", "Exceptional product.", "I can’t live without this product." }; string[] events = new string[] { "Now I feel good.", "I have succeeded with this product.", "Makes miracles. I am happy of the results!", "I cannot believe but now I feel awesome.", "Try it yourself, I am very satisfied.", "I feel great!" }; string[] authors = new string[] { "Diana", "Petya", "Stella", "Elena", "Katya", "Iva", "Annie", "Eva" }; string[] cities = new string[] { "Burgas", "Sofia", "Plovdiv", "Varna", "Ruse" }; // setting the values of all the options of the class advert.Phrases = phrases; advert.Events = events; advert.Authors = authors; advert.Cities = cities; for (int i = 0; i < n; i++) { advert.Randomizer(advert); } }