Programming Exercise 5

  < Previous  Next >

Due Date

See the calendar for due date.

Assignment:

Write a program that asks the user to enter a number of seconds and then prints the same amount of time in days, hours, minutes, and seconds.

Examples

The following are examples of correct execution (with the text in bold being the input from the user):
Please enter number of seconds: 123456
1 day(s), 10 hour(s), 17 minute(s), and 36 second(s)
Please enter number of seconds: 987654
11 day(s), 10 hour(s), 20 minute(s), and 54 sec(s)
After completing the program and testing the output for accuracy, make sure that you have a comment lines at the top of your file with your name, course and section, current date, and assignment description.

Submission

Submit your python script using the handin program. For handin, for this lab, type the following in a terminal window exactly as it appears:
handin  pe5  pe5.py
To verify your submission, type the following in a terminal window:
handin  pe5

Optional

Change the output so that the units are plural, only when the value is not 1. For example:
Enter number of seconds: 123421
1 day, 10 hours, 17 minutes, and 1 second.