Advertisement
Guest User

Acrostic.java

a guest
Oct 15th, 2018
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.12 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Acrostic{
  4.    public static void main(String[] args){
  5.       String[][] adjectives = {{ "Astounding", "Academic"},
  6.          { "Bodacious", "Big-headed", "Baller","Boujee"},
  7.          {"Cantankerous","Cool","Comic sans" },
  8.          {"Daring", "Drip", "Drippier", "Drippiest" , "Dapper", "Dank"},
  9.          {"Energetic", "Enormous", "Elegant" },
  10.          {"Funky", "Failure", "Fantastic", "Fresh", "Female", "French", "Fancy" },
  11.          {"Grand" , "Grumpy" , "Grumpy" },
  12.          {"Humble", "Handsome", "Hardworking" },
  13.          { "Icy", "Icier", "Iciest" , "Idiosyncratic" },
  14.          {"Jolly", "Joyful", "Jovial"},
  15.          {"Kempt","Kind", "Kooky", "Kingly", "Keen" },
  16.          {"Lame", "Lit", "Litto","Litolitious","Litacal-Spitical","Lit like a Pick"},
  17.          {"Mercuric", "Merciless", "Man"},
  18.          {"Noisy", "Numeric", "Nice" },
  19.          { "Obnoxious", "Obstreperous" , "Ostrobogulous" , "One Miserable Star" },
  20.          {"Pythagorean", "Poised" },
  21.          { "Quirky", "Quetzalcoatlus" },
  22.          {"Raging","Radical" },
  23.          { "Swag", "Super", "Smashing", "Spooky" , "Sick"},
  24.          { "Tasteless","Triangular","Trigonometric", "Tricky" },
  25.          { "Ugandan", "Ubery" , "Uncle Rico"},
  26.          { "V for Vendetta", "Vicious", "Vigilant"},
  27.          {"Wiggly", "Witty", "Warty" },
  28.          { "Xenophobic","Xerothermic","Xylophonic"},
  29.          { "Yucky", "Yes", "Yummy"},
  30.          { "Zealous","Zig-Zaggy" }};
  31.    
  32.       Scanner kb = new Scanner(System.in);
  33.      
  34.       //Prompt and receive name
  35.       System.out.print("Enter your name: ");
  36.       String name = kb.next();
  37.      
  38.       //Use for loop to split up name
  39.       for(int i = 0; i < name.length(); i++){
  40.          String letter = name.substring(i, i+1).toUpperCase();
  41.          System.out.print(letter + " is for ");
  42.          for(int j = 0; j < adjectives.length; j++){
  43.             if( adjectives[j][0].substring(0,1).equals(letter) ){
  44.                String adjective = adjectives[j][(int)(Math.random()*adjectives[j].length)];
  45.                System.out.println(adjective);
  46.             }
  47.          }
  48.       }
  49.    }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement