Print out and display a month object properly which is a 2d


The question is as follows:

Write a program that prompts the user for a year (e.g. 1945) and then prints a calendar for that year. The entire year should be laid out in 4 rows of months each consisting of 3 months. Each month should be printed in the following format.
January
S M T W T F S
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

Hint: Use a multidimensional array to store month objects. Implement a method called weekString in the month class that given an integer x between 0-5 returns the string representing the xth week. weekString(2) sent to the month object shown below should return "12 13 14 15 16 17 18". You can't change code until you understand it. Go over the calPrinter classes carefully before you begin.

I've attatched the programs we are given to build the solution out of.

So far ive only been able to use a system.print inside the loop that creates the days of the month to display the month in the Month class. This is completely unformatted and seems like the incorrect way to go about it.

Even some tips or approaches to take would be really helpful. I don't know whether to make a new class or what.

I basically need to print out and display a Month object properly, which is a 2d array. After I can do this, I need to make an array of month objects, and print them out line by line in a 4x3 grid.

Attachment:- Month.rar

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Print out and display a month object properly which is a 2d
Reference No:- TGS02387181

Now Priced at $10 (50% Discount)

Recommended (99%)

Rated (4.3/5)