deyanmalinov

01. Advertisement Message

Mar 12th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.23 KB | None | 0 0
  1. package DPM;
  2. import java.util.*;
  3. public class Main {
  4.         public static void main(String[] args) {
  5.             Scanner scan = new Scanner(System.in);
  6.             int num = Integer.parseInt(scan.nextLine());
  7.             String [] phrases = {"Excellent product.", "Such a great product.", "I always use that product.",
  8.                     "Best product of its category.", "Exceptional product.", "I can’t live without this product."};
  9.             String [] events = {"Now I feel good.", "I have succeeded with this product.",
  10.                     "Makes miracles. I am happy of the results!", "I cannot believe but now I feel awesome." +
  11.                     "", "Try it yourself, I am very satisfied.", "I feel great!"};
  12.             String [] authors = {"Diana", "Petya", "Stella", "Elena", "Katya", "Iva", "Annie", "Eva"};
  13.             String [] cities = {"Burgas", "Sofia", "Plovdiv", "Varna", "Ruse"};
  14.             Random rnd = new Random();
  15.  
  16.             for (int i = 0; i < num; i++) {
  17.                 System.out.printf("%s %s %s - %s\n", phrases[rnd.nextInt(phrases.length)], events[rnd.nextInt(events.length)],
  18.                         authors[rnd.nextInt(authors.length)], cities[rnd.nextInt(cities.length)]);
  19.  
  20.             }
  21.         }
  22. }
Add Comment
Please, Sign In to add comment