Integers Assignment

Program Instructions

1.      See this link for Assignment Policies, Submission Instructions, and Grading Guidelines.

2.      Write a Java program does the following:

3.      Ask the user to enter their age in seconds.

4.      Calculate their age in seconds, minutes, hours, days, & years.  In your calculations, don’t worry about leap years, so 1 year = 365 days.

5.      For example, a person who is 1 billion (1000000000) seconds old is 31 years, 259 days, 1 hour, 46 minutes, and 40 seconds old. A person who is 31626061 seconds old is 1 year, 1 day, 1 hour, 1 minute, and 1 second old.

6.      Use division to calculate the next longer time measurement. For example, 1000000000 age in seconds * (1 minute / 60 seconds) = (1000000000 / 60) age in minutes = 16666666 age in minutes.

7.      Use modulus to calculate the remaining times. For example, 1000000000 age in seconds % 60 seconds = 40 age in remaining seconds. So from these two calculations we know that this person is 16666666 minutes, 40 seconds old.

 

 

 

© 2007 William Albritton