Advertisement
Guest User

01. Advertisement Message

a guest
Dec 15th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. package com.company;
  2.  
  3. import java.util.Random;
  4. import java.util.Scanner;
  5.  
  6. public class Main {
  7.  
  8. public static void main(String[] args) {
  9. Scanner sc= new Scanner(System.in);
  10. int numberFake = Integer.parseInt(sc.nextLine());
  11. String[] phrases = {"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." };
  12. String[] events = {"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!" };
  13. String[] authors = { "Diana", "Petya", "Stella", "Elena", "Katya", "Iva", "Annie", "Eva" };
  14. String[] cities = { "Burgas", "Sofia", "Plovdiv", "Varna", "Ruse"};
  15. Random random= new Random();
  16.  
  17. for (int i = 0; i < numberFake; i++) {
  18. String phrase = phrases[random.nextInt(phrases.length)];
  19. String event = events[random.nextInt(events.length)];
  20. String author = authors[random.nextInt(authors.length)];
  21. String city = cities[random.nextInt(cities.length)];
  22. System.out.println(phrase + " " + event + " " + author + " – " + city + "." );
  23.  
  24.  
  25.  
  26. }
  27.  
  28.  
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement