SIBT COMP 125

Week 4 Practical Exercises

1. (Repeated from last week) Write a class that will ask the user to input the current date and then use this date to calculate the time remaining until the year 2000 (to make things simpler, calculate the time remaining from midnight of the date entered). You must, however, give the user a choice of whether they want to see this time remaining in days, hours, minutes or seconds. (Hint: Use the inspect statement for this choice).

2. Based on the above question, write code that will calculate how many days, hours, minutes, or seconds since the beginning of the year.

3. Using the features of the STRING class, how could I convert a date entered as a string (i.e. "15/11/1999") into three integers (i.e. day := 15, month :=11, year := 1999)?