Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program to implement Undo Redo Functionality using stack. Your program should working like user is typing something on screen and when he/she


Write a program to implement Undo Redo Functionality using stack. Your program should working like user is typing something on screen and when he/she press Ctrl+z then last character will be remove from screen and when he/she press again Ctrl+z then previous character will be remove from screen and if he/she press Ctrl+y then last removed character will display again on screen. Note: To write this program you first need to understand that how we can detect pressed key from user in python. I am writing C# code below for the sake of example. Consolekeylnfo input = Console.ReadKey(); while (input.Key != Consolekey.Enter) { if (!char.IsControl(input.KeyChar) { //Do some code when user press any printing character) else if (input. Modifiers Ctrl+Z Key } else if (input.Modifiers when user press Ctrl+Y Key} else if (input.Key backspace Key} }//End While Loop Consolekey.Z){ //Write some code when user press ConsoleKey.Y) {//Write some code ConsoleKey.Backspace) { //Write some code when user press ConsoleModifiers.Control && input.Key %3D3D ConsoleModifiers.Control && input.Key

Step by Step Solution

There are 3 Steps involved in it

Step: 1

Program class Node def initself dataNone selfdata data selfnext None selfprev None def strself retur... 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 Structures and Algorithm Analysis in Java

Authors: Mark A. Weiss

3rd edition

132576279, 978-0132576277

More Books

Students also viewed these Algorithms questions