forked from P1-FemCoders-VLC/java-loops
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStrawberryFields.java
More file actions
111 lines (90 loc) · 3.07 KB
/
Copy pathStrawberryFields.java
File metadata and controls
111 lines (90 loc) · 3.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
public class StrawberryFields {
//Escribe un programa que permita imprimir la canción Strawberry Fields Forever con un bucle. Solo puedes tener 2 funciones, una que imprima los versos y otra que imprima el coro.
//Busca información sobre bucles anidados.
//Al final está la letra completa
public static void main(String[] args) {
int[] song = {-1,0,-1,1,-1,2,-1};
for (int i = 0; i < song.length; i++){
if(song[i] == -1){
playChorus();
} else {
playVersus(song[i]);
}
}
}
/**
* Function name: playVersus
*
* @param number (int)
*
* Inside the function:
* 1. print versus according the position number
*/
public static void playVersus (int number){
String[] songVersus = {
"Living is easy with eyes closed\n" +
"Misunderstanding all you see\n" +
"It's getting hard to be someone, but it all works out\n" +
"It doesn't matter much to me\n",
"No one I think is in my tree\n" +
"I mean, it must be high or low\n" +
"That is, you can't, you know, tune in, but it's alright\n" +
"That is, I think it's not too bad\n",
"Always, no sometimes, think it's me\n" +
"But you know, I know when it's a dream\n" +
"I think I know, I mean a yes\n" +
"But it's all wrong\n" +
"That is, I think I disagree\n"
};
System.out.println(songVersus[number]);
}
/**
* Function name: playChorus
*
* Inside the function:
* 1. print chorus
*/
public static void playChorus(){
System.out.println("Let me take you down\n" +
"Cause I'm going to strawberry fields\n" +
"Nothing is real\n" +
"And nothing to get hung about\n" +
"Strawberry fields forever\n");
}
}
/*
Strawberry Fields Forever
Let me take you down
'Cause I'm going to strawberry fields
Nothing is real
And nothing to get hung about
Strawberry fields forever
Living is easy with eyes closed
Misunderstanding all you see
It's getting hard to be someone, but it all works out
It doesn't matter much to me
Let me take you down
'Cause I'm going to strawberry fields
Nothing is real
And nothing to get hung about
Strawberry fields forever
No one I think is in my tree
I mean, it must be high or low
That is, you can't, you know, tune in, but it's alright
That is, I think it's not too bad
Let me take you down
'Cause I'm going to strawberry fields
Nothing is real
And nothing to get hung about
Strawberry fields forever
Always, no sometimes, think it's me
But you know, I know when it's a dream
I think I know, I mean a yes
But it's all wrong
That is, I think I disagree
Let me take you down
'Cause I'm going to strawberry fields
Nothing is real
And nothing to get hung about
Strawberry fields forever
*/