Write a program that calculates and prints the number of minutes in a year.
Save this file as MinutesInYear.java.
Save this file as MinutesInYear.java.
01 | /* Source: http://en.wikipedia.org/wiki/Year |
02 | * A calendar year in the Gregorian calendar |
03 | * (as well as in the Julian calendar) has either |
04 | * 365 (common years) or 366 (leap years) days. |
05 | */ |
06 |
07 | public class MinutesInYear { |
08 | public static void main(String [] args) { |
09 | System.out.println( "Minutes in a year(leap year): " + ( 60 * 24 * 365 )); |
10 | System.out.println( "Minutes in a year(common year): " + ( 60 * 24 * 366 )); |
11 |
12 | } |
13 | } |
0 comments:
Post a Comment