S
S
Sergey Sergey2021-04-19 18:48:47
Java
Sergey Sergey, 2021-04-19 18:48:47

To write a calendar for 5 years (output all 5 years through a for loop) or output one year through a loop and the rest ... how to write?

Can apply some sort of algorithm to help the loop.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Roo, 2021-04-19
@Sergei1111

The elephant must be eaten in pieces.
1. Write a method that prints the month. The input data will be - the number of days and the day of the week on which the first number falls.
2. Write a method that prints the year. The input data will be - the day of the week on which the first number falls and the leap year flag. Let this method launch the method from item 1 giving it the necessary information.
3. Write a method that prints a calendar for several years. If you implement p1 and p2, I think you will already figure it out with p3.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question