Last active
December 27, 2015 00:18
-
-
Save imryan/7236228 to your computer and use it in GitHub Desktop.
Bottles of soda on the wall, since beer is bad.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class Bottles | |
{ | |
public static void main(String[] args) | |
{ | |
// Declare variables | |
Scanner sc = new Scanner(System.in); | |
int verses = 0; | |
// Input value for verses | |
System.out.println("How many verses to hear?: \n"); | |
verses = sc.nextInt(); | |
// Call spitRhymes() method | |
for (int i = verses; i >= 1; i--) | |
{ | |
String verse = i + " bottles of soda on the wall, " + i + " bottles of soda.\nTake one down, pass it around, " + i + " bottles of soda on the wall.\n"; | |
System.out.println(verse); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment