Question: Would someone be able to help me with this java Calendar assignment? I ' m not sure where to start and a little lost. Assignment
Would someone be able to help me with this java Calendar assignment? Im not sure where to start and a little lost. Assignment : Calendar Part with Classes
Objective: Enhance the calendar program by introducing objectoriented programming concepts. This assignment will have you create a basic class to represent the calendar, encapsulate data, and provide methods to interact with that data. This will help you practice designing classes and using objects to manage and organize your code effectively.
Requirements:
Create a colendarklonth Class:
Define a class called Calendarkinth to represent a calendar month.
The class should contain the following attributes:
A singledimensional array to store the names of the days of the weck.
A multidimensional array to store the day numbers for the entire calendar month.
An integer for the number of days in the month.
An integer for the starting day of the week eg for Sunday, for Monday, etc
Constructor:
Implement a constructor that takes the number of days in the month and the starting day of the week as parameters.
The constructor should initialize the day names array, the multidimensional array for day numbers, and populate the array with the correct day numbers. Note that you are not required to make the day numbers align correctly with the starting day of the weekjust populate the calendar sequentially. However, extra credit will be awarded if you implement the calendar so that the starting day of the month aligns with the correct day of the week.
Methods:
Implement the following methods:
void sopulatealendar : Populates the multidimensional array with the day numbers for the month, similar to the sopulatealendararray method from the previous assignment.
void printCalender : Prints the calendar for the month, using the day names array as a header and the multidimensional array to print the day numbers.
boolean aboyvalidint doy: Checks if a given day is valid for the current month.
wid printDogint day: Prints information about a specific day, including the day of the week.
Main Program in the Same File as a separate class:
Create a method in the same file as the class, but in a different class. In other words, one java file, but two classes in the same file, just like the examples from the lecture videos.
In your method, create an instance of the class.
Prompt the user for the number of days in the month and the starting day of the week.
Use the object to print the full calendar and to interactively check if specific days are valid.
Example:
When creating a for a month that starts on a Wednesday and has days, the populatecalendar method should populate the array with day numbers sequentially. You are not required to align the start day of the month with the correct day of the week, but extra credit will be awarded if you choose to implement that feature.
Example Output:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
