Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please I need help with this project. Can you build a java code for this project and please include a screen shot of the result

Please I need help with this project. Can you build a java code for this project and please include a screen shot of the result to show that the program was successful.
Project- Multi-Level Undo
Task 1- Undo Menu Action Package: edu.institution.actions.asn10 Class: UndoAction (Use the supplied Scanner instance to prompt the user for information. Do not create your own instance of Scanner in any action) In this action you keep a history of all actions that can be undone. The user will initiate the undo action from the menu. Your undo action will reverse the actions taken in your LinkedIn application. The last action taken is the first to be undone. This last-in-first-out (FIFO) requirement demands the use of the Stack collection. There should only be one stack for the entire application and this stack needs to be available to every instance of a menu action -- one instance available to the entire JVM (a static property). Actions that need to add to the action history should push their action to the history stack.
The process method for the action should return true to keep the user signed in.
Undoing an Action
Your undo action should retrieve the last action from the action history and display the message, "The last menu option selected was "" involving . Undo? (Y/N)"(Replace with the user's actual user name andwith the text of the selected menu option). If the user enters "Y", then undo the last action. If the user enters any other value other than return true to remain signed in and end the action. Example 1 Barney logs in to the application and adds Betty as a new user. Next, Barney adds Betty as a connection. Barney chooses the Undo option. The application should display, "The last menu option selected was "Add Connection" involving Barney. Undo (Y/N)". If the user enters "Y" then the undo action is performed. (i.e. Betty is removed from Barney's connection list). Example 2 Another example. Barney logs in to the application and signs up Betty as a new user in LinkedIn. Barney selects the Undo option. The application should display, "The last menu option selected was "Sign up a New User" involving Betty. Undo (Y/N)". If the user enters "Y" then the undo action is performed. (i.e. Betty is deleted from LinkedIn).
Additional Requirements Once an action is undone, it is removed from the action history (pop the stack). If there are no actions left to undo, display an error message to the user stating so. When an action is undone, display a message stating what the result was.
For example, if the last action was deleting user Barney, then undoing that would entail adding Barney back. This should result in a message like "Added back Barney". When a user is deleted, any connections list that contained that user is also affected. When the Delete a User action is undone, you only need to restore the user. You don't have to restore the connections that were modified. Exiting the Application or Signing Off We do not want to save the action history upon exiting the application or if the user chooses to sign off. Upon logging into application, there should be no history to undo. Minimum Actions Required At a minimum, you are required to implement undo functionality for the Add Connection and Remove Connection options. You will receive one extra credit point for any of the other four options that you make undo-able.

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

Data Mining Concepts And Techniques

Authors: Jiawei Han, Micheline Kamber, Jian Pei

3rd Edition

0123814790, 9780123814791

More Books

Students also viewed these Databases questions

Question

How do organizations encourage political activity?

Answered: 1 week ago