Last active
August 29, 2015 14:19
-
-
Save jonathan-irvin/0e6c9d238e5ef8ea7544 to your computer and use it in GitHub Desktop.
Convert minutes to years
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 Minutes2Years { | |
public static void main(String[] args) { | |
// TODO Auto-generated method stub | |
System.out.print("Enter the number of minutes: "); | |
Scanner input = new Scanner(System.in); | |
int minutes; | |
minutes = input.nextInt(); | |
//525949 minutes per year | |
int years = minutes / 525949; | |
//1440 minutes per day | |
int days = (minutes % 525949) / 1440; | |
System.out.println(minutes + " minutes is "+ years + " years and "+days+" days."); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment