Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need help on this Java program. There are what I have so far for The Date class and The DateDemo class. I don't know
I need help on this Java program.
There are what I have so far for The Date class and The DateDemo class.
I don't know how to write a code to determine day of week using 2 arrays as requirements.
Please have a full code (and comment if applicable)
Thank you
Implementing a Gregorian Date Class Implement a basic Date class whose objects represent dates on the Gregorian calendar with no exception-handling capability, Also, write a tester class, DateDemo, that creates Date objects using the constructors, modifies them and prints them out in the day-of-the-week, month-name day, year format using the printf statement. The Date Class fields of a Date object The Date class should have month, day and year, all integers, as the The class should include the following constructors: Date): creates January 1, 1970 Date/int m, int d, int y): creates a Date object using the specified parameters, where m represents the month, d, the day, and y, the year Date(Date date): creates an object of the Date class equivalent to the specified date object The Date class should have the following instance (accessor and mutator) methods: int getMonthO: returns the month in an object of the Date class int getDay): returns the day in an object of the Date class int get Year): returns the year in an in object of the Date class vold setDatelint m, int d, int y): modifies a Date object using the specified parameters where m represents the month, d, the day, and y, the year The DateDemo Class Write a program, DateDemo, that does the following 1. Prompts the user for the first day of class. 2. Reads a string in the format mm ddyyy, parses the string into three integers representing the month, day and year, and uses the parameterized constructor to create a Date object using the three values. 3. Using the copy constructor, creates a second Date object that represents the last day of class. Use the first day of class as an explicit parameter to the constructor 4. Using appropriate accessor methods, prints the first day of class class in day-of-the-week month-name day, year format
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started