Practice
Junior Example Problem 4: Dates and Days
Instructions
- Write a program that will input a date in the form dd mm yyyy and output the day of the week and the day of the year on that date.
- Your program should continue this process until zero is given for the day, month and year.
- Your output should contain one day of the week and a day of the year each line.
- No other output should be produced by your program.
- Use the input given in the Data section for the output you will submit.
- The last day of 2000 (31/12/2000) was a Sunday. This was the 366th day of the year. The year 2000 was a leap year.
Example
-
Given the input:
31 07 2001
10 09 2002
25 12 2002
23 05 2003
05 03 2004
0 0 0
-
Your program should output
Tuesday 212
Tuesday 253
Wednesday 359
Friday 143
Friday 65
Data
-
Use the following data to gain your solution for submission...
31 07 2001
20 09 2001
25 12 2001
31 12 2002
25 12 2004
0 0 0