Logout

Home Topic 4Last Next

"Shake It Off" Taylor Swift (2014) Trace

 1 package _Text_Book;
 2 
 3 /**
 4  *
 5  * @author jrayworth
 6  */
 7 public class ShakeItOff {
 8     //Cause the players gonna play, play, play,
 9     //And the haters gonna hate, hate, hate,
10     //Baby I'm just gonna shake, shake, shake,
11     //Shake it off, Shake it off,
12 
13     //Heartbreakers gonna break, break, break,
14     //And the fakers gonna fake, fake, fake,
15     //Baby I'm just gonna shake, shake, shake,
16     //Shake it off.
17     //http://www.youtube.com/watch?v=nfWlot6h_JM
18     //                                    [0]       [1]           [2]           [3]
19     static String playersEtc[] = {"players", "haters", "Heartbreakers", "fakers"};
20 
21     //                                    [0]       [1]           [2]           [3]
22     static String whatGonnaDoArray[] = {"play", "hate", "break", "fake"};
23 
24     public static void mainChorus(String part) {
25 
26         if (part.equals("part 1")) {
27             for (int k = 0; k < 2; k++) {
28                 System.out.print("Cause the " + playersEtc[0] + " gonna "); 
29                 whatGonnaDoMethod(whatGonnaDoArray[0], 5);                  
30                 System.out.print("And the " + playersEtc[1] + " gonna ");   
31                 whatGonnaDoMethod(whatGonnaDoArray[1], 5);                   
32 
33                 System.out.print("Baby I'm just gonna ");
34                 for (int j = 0; j < 5; j++) {
35                     System.out.print("shake, ");
36                 }
37                 System.out.println("");
38 
39                 for (int j = 0; j < 2; j++) {
40                     System.out.print("Shake it off, ");
41                 }
42                 System.out.println("");
43             }
44         } else if (part.equals("part 2")) {
45             for (int k = 0; k < 2; k++) {
46                 System.out.print("Cause the " + playersEtc[2] + " gonna "); 
47                 whatGonnaDoMethod(whatGonnaDoArray[2], 5);                   
48                 System.out.print("And the " + playersEtc[3] + " gonna ");   
49                 whatGonnaDoMethod(whatGonnaDoArray[3], 5);                   
50 
51                 System.out.print("Baby I'm just gonna ");
52                 for (int j = 0; j < 5; j++) {
53                     System.out.print("shake, ");
54                 }
55                 System.out.println("");
56 
58                 System.out.print("Shake it off.");
59                 
61             }
62         }
63 
64     }
65 
66     public static void whatGonnaDoMethod(String whatToDo, int n) {
67 
68         for (int i = 0; i < n; i++) {
69             System.out.print(whatToDo + ", ");
70         }
71         System.out.println("");
72     }
73 
74     public static void main(String[] args) {
75         System.out.println("And now, topping the Billboard 100, it's Shake It Off!");
76         System.out.println("-------------------------------------------");
77         mainChorus("part 1");
78         System.out.println("");
79         mainChorus("part 2");
80         System.out.println("-------------------------------------------");
81         System.out.println("This is even better than the one with the goat! ;-)");
82     }
83 }
84