Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package happybirthday;
- import java.util.ArrayList;
- import java.util.Collections;
- import java.util.Random;
- import java.util.Scanner;
- public class Main {
- public static ArrayList<Integer> luckyNumbers = new ArrayList<Integer>();
- static Integer luckyNumber;
- public static void main(String[] args) {
- welcomeMessage();
- displayOption();
- }
- private static void welcomeMessage() {
- System.out.println("Happy Birthday to YOU! Happy Birthday to YOU \n" +
- "I wish I can be with you now to hug you for real but there is a lot of kilometres between us. \n" +
- "Let me talk to you in Java language with Java Virtual Machine. \n" +
- "This is the virtual version of Daniela that is gonna sing for you BIRTHDAY WISHES. \n");
- }
- private static void displayOption() {
- System.out.println("What is your wish now?\n" +
- "Please enter a single digit. \n \n" +
- "1 - Gift Generator\n" +
- "2 - Let's drink together! \n" +
- "3 - Let's eat the cake! \n" +
- "4 - Goodbye! \n \n" +
- "Your choice:");
- Scanner input = new Scanner(System.in);
- int userChoice = input.nextInt();
- switch (userChoice) {
- case 1:
- giftGenerator();
- break;
- case 4:
- System.out.println("Goodbye! Happy Birthday again! XX \n" +
- "☆┌─┐ ─┐☆ \n" +
- " │▒│ /▒/ \n" +
- " │▒│/▒/ \n" +
- " │▒ /▒/─┬─┐ \n" +
- " │▒│▒|▒│▒│ \n" +
- "┌┴─┴─┐-┘─┘ \n" +
- "│▒┌──┘▒▒▒│ \n" +
- "└┐▒▒▒▒▒▒┌┘ \n" +
- " └┐▒▒▒▒┌┘ ");
- break;
- default:
- switch (userChoice) {
- case 2:
- drink();
- break;
- case 3:
- cake();
- break;
- }
- displayOption();
- }
- }
- private static void giftGenerator() {
- System.out.println("Do not worry - the older you get, the better you get. \n" +
- "Please enter your new age below:");
- addLuckyNumber();
- System.out.println("\nAwesome! You just achieved new level in the Game of you Life after getting enough EXP. :D \n" +
- "Do you have your own lucky number? \n" +
- "Please enter it below:");
- addLuckyNumber();
- System.out.println("\nWhat is your favourite color?\n" +
- "1 - black | 2 - white | 3 - pink | 4 - blue | 5 - RAINBOW | 6 - green | 7 - red | 8 - 50 shades of grey | 9 - yellow " +
- "Please enter its number below:");
- addLuckyNumber();
- System.out.println("\nNow my special Java calculator is gonna generate for your birthday gift. Waaait, time for loooaading...");
- Random random = new Random();
- int random1 = random.nextInt(49);
- luckyNumbers.add(random1);
- int random2 = random.nextInt(49);
- luckyNumbers.add(random2);
- int random3 = random.nextInt(49);
- luckyNumbers.add(random3);
- System.out.println("When you celebrate your birthday - all sweets and alcohol have no calories. \n" +
- "You can enjoy also +10000 to your luckiness. So here we have your lucky numbers for LOTTO today: \n");
- Collections.sort(luckyNumbers);
- for (int i = 0; i < luckyNumbers.size(); i++ ) {
- System.out.println(luckyNumbers.get(i));
- }
- System.out.println("\nHappy Birthday again!");
- }
- private static void addLuckyNumber() {
- Scanner input = new Scanner(System.in);
- luckyNumber = input.nextInt();
- luckyNumbers.add(luckyNumber);
- }
- private static void drink() {
- System.out.println("* * . * .\n" +
- " .. * o\n" +
- " o * . *\n" +
- " ________\n" +
- " (________)\n" +
- " | o |\n" +
- " | o o |\n" +
- " | o |\n" +
- " | o o |\n" +
- " | o o |\n" +
- " | o |\n" +
- " ( o )\n" +
- " \\ o /\n" +
- " \\ /\n" +
- " \\ /\n" +
- " ||\n" +
- " ||\n" +
- " ||\n" +
- " || CHEERS!\n" +
- " ||\n" +
- " ___||___\n" +
- " / || \\\n" +
- " \\________/ \n");
- }
- private static void cake() {
- System.out.println(" .::, ::():: .::,\n" +
- " ::():: '|\\` ::()::\n" +
- " '/|`____||___'|\\`\n" +
- " _||'::, ||.::,||._\n" +
- " ,' ||:():: ::():|| `.\n" +
- " | '|\\` '/|` |\n" +
- " | || || |\n" +
- " |`._ || || _.-'|\n" +
- " |`._`-.,-._____.-.'_.-'|\n" +
- " | `-/\\ `. .' /\\ |\n" +
- " |`-._/ `--( )--' \\.-'|\n" +
- " `._ `-._.-/|\\-._.-'_.'\n" +
- " `-.__.' | `._.-'\n" +
- " /,'\\| . \\\n" +
- " |/ `.\\");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement