Advertisement
tanya_zheleva

2

Feb 12th, 2017
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.71 KB | None | 0 0
  1. using System;
  2. using System.Globalization;
  3. using System.Linq;
  4.  
  5. namespace ExamPreparation
  6. {
  7.     public sealed class Startup
  8.     {
  9.         public static void Main()
  10.         {
  11.             string[] phrases = new string[]
  12.             {
  13.                "Excellent product.", "Such a great product.", "I always use that product.",
  14.                "Best product of its category.", "Exceptional product.", "I can’t live without this product."
  15.             };
  16.  
  17.             string[] events = new string[]
  18.             {
  19.                 "Now I feel good.", "I have succeeded with this product.",
  20.                 "Makes miracles. I am happy of theresults!", "I cannot believe but now I feel awesome.",
  21.                 "Try it yourself, I am very satisfied.", "I feel great!"
  22.             };
  23.  
  24.             string[] authors = new string[]
  25.             {
  26.                 "Diana", "Petya", "Stella", "Elena", "Katya", "Iva", "Annie", "Eva"
  27.             };
  28.  
  29.             string[] cities = new string[]
  30.             {
  31.                 "Burgas", "Sofia", "Plovdiv", "Varna", "Ruse"
  32.             };
  33.  
  34.             int n = int.Parse(Console.ReadLine());
  35.             Random rnd = new Random();
  36.  
  37.             for (int i = 0; i < n; i++)
  38.             {
  39.                 int randomPhrase = rnd.Next(0, phrases.Length);
  40.                 int randomEvent = rnd.Next(0, events.Length);
  41.                 int randomAuthor = rnd.Next(0, authors.Length);
  42.                 int randomCity = rnd.Next(0, cities.Length);
  43.  
  44.                 string message = phrases[randomPhrase] + " " + events[randomEvent] + " " +
  45.                     authors[randomAuthor] + " - " + cities[randomCity];
  46.  
  47.                 Console.WriteLine(message);
  48.             }
  49.         }
  50.     }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement