Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Exercise;
- import java.util.Random;
- import java.util.Scanner;
- public class O1AdvertisementMessage {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int number = Integer.parseInt(scanner.nextLine());
- String[] phrase = 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."};
- 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!"};
- String[] author = new String[]{"Diana", "Petya", "Stella", "Elena", "Katya", "Iva", "Annie", "Eva"};
- String[] city = new String[]{"Burgas", "Sofia", "Plovdiv", "Varna", "Ruse"};
- Random index = new Random();
- for (int i = 0; i < number; i++) {
- int phaseRandom = index.nextInt(phrase.length-1);
- int eventsRandom = index.nextInt(events.length-1);
- int authorRandom = index.nextInt(author.length-1);
- int cityRandom = index.nextInt(city.length-1);
- System.out.println(phrase[phaseRandom] + " " + events[eventsRandom] + " " + author[authorRandom] + " - " + city[cityRandom]);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment