Created
August 11, 2017 22:09
-
-
Save nitrodragon/8f6a5fbc16582250f7ab06348a53cfdc to your computer and use it in GitHub Desktop.
Ever wondered exactly how many bottles of beer on the wall there really are?
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 BeersOnTheWall { | |
public static void main(String[] args) { | |
Scanner sc = new Scanner(System.in); | |
System.out.println("Enter the amount of hours in your trip:"); | |
int hours = sc.nextInt(); | |
System.out.println("Now the minutes:"); | |
int minutes = sc.nextInt(); | |
int beers = (((hours * 60) * 60) / 8) + ((minutes * 60) / 8); | |
sc.close(); | |
System.out.println("On a trip that is " + hours + " hours and " + minutes + " minutes long, there are " + beers + " bottles of beer on the wall (with a margin of error of about 8), assuming your tempo is 120bpm."); | |
System.out.println("Start counting."); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment