Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please include extra credit. All in JAVA. The following date of the form: MM-DD-YYYY would be palindromic if it read the same way backwards: YY-YY-DDMM.

image text in transcribedimage text in transcribedPlease include extra credit. All in JAVA.

The following date of the form: MM-DD-YYYY would be palindromic if it read the same way backwards: YY-YY-DDMM. For example, the date: 12-02-2021 is palindromic. Write a method getPalindromicDate that takes an integer (a year) as input and then returnsa palindromic date. The palindromic date should be stored in a stack based data structure using dynamic memory allocation (LinkedStack). If the year does not give a palindromic date, then the returned stack will be null. Only Gregorian calendar dates are allowed and the stack should maintain the ordering of the dates as: Where MM is the top of the stack. MM and DD must be two digits, so if there is a single digit a zero must precede it. For example, the following date: 03-12-2130. The following palindrome would not be a valid palindromic date: 40-52-2504, because there is not a 40th month of the year, nor a 52nd day in any given month Write a driver program that will test the getPalindromicDate method by printing out the stack returned with the appropriate formatting to appear palindromic and as a date, given there is such a date for the given year

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases And Information Systems 22nd European Conference Adbis 2018 Budapest Hungary September 2 5 2018 Proceedings Lncs 11019

Authors: Andras Benczur ,Bernhard Thalheim ,Tomas Horvath

1st Edition

3319983970, 978-3319983974

More Books

Students also viewed these Databases questions

Question

=+What is the nature of the plant or site-level role of unions?

Answered: 1 week ago