Print dates of a year with an offset

Report a typo

Write a program that prints all dates of the given year with a specified offset applied.

It should read a starting date and a value of an offset (in days).

In the output, dates should be printed in ascending order with the starting date included. Do not output the dates from the next year.

Sample Input 1:

2017-12-19
4

Sample Output 1:

2017-12-19
2017-12-23
2017-12-27
2017-12-31

Sample Input 2:

2017-09-22
100

Sample Output 2:

2017-09-22
2017-12-31
Write a program in Java 17
class Main {
public static void main(String[] args) {
// put your code here
}
}
___

Create a free account to access the full topic