Ivan_Bochev

Products

Jan 8th, 2020 (edited)
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.52 KB | None | 0 0
  1. package t3;
  2. import java.util.*;
  3. public class Zadacha {
  4.  
  5.     public static void main(String[] args) {
  6.         ArrayList<String> phrase=new ArrayList<>(Arrays.asList("Продуктът е отличен.", "Това е страхотен продукт.", "Постоянно ползвам този продукт.", "Това е най-добрият продукт от тази категория."));
  7.         ArrayList<String> happen=new ArrayList<>(Arrays.asList("Вече се чувствам добре.", "Успях да се променя.", "Той направи чудо.", "Не мога да повярвам, но вече се чувствам страхотно.", "Опитайте и вие. Аз съм много доволна."));
  8.         ArrayList<String> fName=new ArrayList<>(Arrays.asList("Диана", "Петя", "Стела", "Елена", "Катя"));
  9.         ArrayList<String> lName=new ArrayList<>(Arrays.asList("Иванова", "Петрова", "Кирова"));
  10.         ArrayList<String> city=new ArrayList<>(Arrays.asList("София", "Пловдив", "Варна", "Русе", "Бургас"));
  11.        
  12.         Random rand=new Random();
  13.         int randomPhrase=rand.nextInt(phrase.size());
  14.         int randomHappen=rand.nextInt(happen.size());
  15.         int randomFName=rand.nextInt(fName.size());
  16.         int randomLName=rand.nextInt(lName.size());
  17.         int randomCity=rand.nextInt(city.size());
  18.         System.out.println(phrase.get(randomPhrase)+" "+happen.get(randomHappen)+" "+fName.get(randomFName)+" "+lName.get(randomLName)+", "+city.get(randomCity));
  19.     }
  20.  
  21. }
Add Comment
Please, Sign In to add comment