StoimenK

C#_Objects_and_Classes_1.1.Advertisement_Message

Feb 25th, 2020
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.52 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7.  
  8. namespace _1._1.Adv_Message
  9. {
  10.     class Program
  11.     {
  12.         static void Main()
  13.         {
  14.             int messagesNumber = int.Parse(Console.ReadLine());
  15.  
  16.             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." };
  17.  
  18.             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!" };
  19.             string[] authors = new string[] { "Diana", "Petya", "Stella", "Elena", "Katya", "Iva", "Annie", "Eva" };
  20.             string[] towns = new string[] { "Burgas", "Sofia", "Plovdiv", "Varna", "Ruse" };
  21.  
  22.             Random number = new Random();
  23.  
  24.             for (int message = 0; message < messagesNumber; message++)
  25.             {
  26.                 int phraseIndex = number.Next(0, phrases.Length);
  27.                 int eventIndex = number.Next(0, events.Length);
  28.                 int authorIndex = number.Next(0, authors.Length);
  29.                 int townIndex = number.Next(0, towns.Length);
  30.  
  31.                 Console.WriteLine(phrases[phraseIndex] + " " + events[eventIndex] + " " + authors[authorIndex] + " - " + towns[townIndex]);
  32.             }
  33.  
  34.         }
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment