Question: Need help with java program, please explain it. I'm having a hard time doing it You've just joined a software team for a company that
Need help with java program, please explain it. I'm having a hard time doing it

You've just joined a software team for a company that makes a diary program. The diary program lets the user write a new entry at the end of each day, filing it into the diary program's archive. This archive is organized as a stack, where new entries are pushed on top, so the entries are ordered from most recent to oldest. You've been asked to help build a new calendar feature, that's essentially just the diary feature in reverse - now, the user can write a new entry for a day to come, which will be added to a queue of days ordered from the oldest-added entry (the nearest day) to the most recently added entry (the furthest day). Your supervisor likes the symmetry of old calendar entries leaving the queue to become new diary entries. There's just one problem: the original designers of the software didn't include support for queues in the program's database, only stacks. As a work-around, you've been asked to build your own version of a queue class that is built on top of two stacks. You should use the built-in Java Stack class (set to take Strings) to represent these stacks, but your stack-based queue does not need to officially implement a queue interface or extend any existing class, so long as it correctly implements the methods from a Queue's ADT. You must submit one Java file with one class, the stack-based queue. The test file must test all of the standard functions of a queue, proving that it works as a queue is expected to. You may assume the diary entries and calendar entries are both simple Strings, and may make up whatever dummy test values for them you want. You need not show your stack-based queue passing hypothetical calendar entries back to a diary-storing stack, unless of course you feel like it. In your written answer, walk through how your stack uses the two stacks to implement each of a queue's functions, and include an asymptotic run-time analysis for each of these stack-based queue functions. If any of the run-times have changed, be sure to note this and explain why. You've just joined a software team for a company that makes a diary program. The diary program lets the user write a new entry at the end of each day, filing it into the diary program's archive. This archive is organized as a stack, where new entries are pushed on top, so the entries are ordered from most recent to oldest. You've been asked to help build a new calendar feature, that's essentially just the diary feature in reverse - now, the user can write a new entry for a day to come, which will be added to a queue of days ordered from the oldest-added entry (the nearest day) to the most recently added entry (the furthest day). Your supervisor likes the symmetry of old calendar entries leaving the queue to become new diary entries. There's just one problem: the original designers of the software didn't include support for queues in the program's database, only stacks. As a work-around, you've been asked to build your own version of a queue class that is built on top of two stacks. You should use the built-in Java Stack class (set to take Strings) to represent these stacks, but your stack-based queue does not need to officially implement a queue interface or extend any existing class, so long as it correctly implements the methods from a Queue's ADT. You must submit one Java file with one class, the stack-based queue. The test file must test all of the standard functions of a queue, proving that it works as a queue is expected to. You may assume the diary entries and calendar entries are both simple Strings, and may make up whatever dummy test values for them you want. You need not show your stack-based queue passing hypothetical calendar entries back to a diary-storing stack, unless of course you feel like it. In your written answer, walk through how your stack uses the two stacks to implement each of a queue's functions, and include an asymptotic run-time analysis for each of these stack-based queue functions. If any of the run-times have changed, be sure to note this and explain why
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
