Write a program to implement Undo Redo Functionality using stack. Your program should working like user...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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 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
Expert Answer:
Answer rating: 100% (QA)
Program class Node def initself dataNone selfdata data selfnext None selfprev None def strself retur... View the full answer
Related Book For
Data Structures and Algorithm Analysis in Java
ISBN: 978-0132576277
3rd edition
Authors: Mark A. Weiss
Posted Date:
Students also viewed these algorithms questions
-
Perform the dry runs only in python A) Write an algorithm that prints or returns the all nodes that contain a negative number or value in the linked list. A -8 4 -6- D 5 Your programs takes input a...
-
Perform in Python Write a code that calculates the total score for students in a class. Suppose the scores are stored in a three-dimensional array named scores. The first index in scores refers to a...
-
Python Company leased equipment from Hope Leasing on January 1, 2011. Hope purchased the equipment at a cost of $222,666. There is no expected residual value. Required: Prepare appropriate journal...
-
A manufacturing company reports the following information for the month of May. Note: Assume all raw materials were used as direct materials. Activities for May Advertising expense Raw materials...
-
The CEO of a manufacturing firm wants everyone to support the organizations dominant culture of lean efficiency and hard work. The CEO has introduced a new reward system to reinforce this culture and...
-
You have been asked by the Payroll Manager, Linda Laporte, to create a short job aid to assist the payroll practitioners with reconciling the Revenu Qubec (RQ) account. Your organization is a monthly...
-
On February 16, 2005, Joseph and Margaret Buset borrowed $192,000 from Fremont Investment & Loan (the Originator). The loan was secured by a mortgage on a residential condominium. The mortgage named...
-
Mini- Case: Going- Concern Reporting. Refer to the mini-case GM: Running on Empty on page C11 and respond to questions 1 6. 1. Reviewing GMs financial information in GM Exhibit 1 and its stock price...
-
Need help with this relational model, please. I am having trouble understanding how to create the relational model.
-
The New Branch School District operates a fleet of 40 buses that serve approximately 1,000 students in grades K12. The bus operation involves 30 regular routes, plus special routes for activities,...
-
Write a paper on Optimal Bundle Design
-
What is the relationship between diversification and firm performance?
-
Building on the CEO-successor selection process described in the box entitled How Would You Do That? 1, devise a succession plan for the dean of your business school. Be sure to include the following...
-
What are some of the external causes of organizational failure?
-
What factors tend to limit the attractiveness of diversification?
-
How does a dynamic industry context affect the possible benefits of diversification?
-
"Of one thing, I feel certain this same kind of technical progress which, in itself, might relieve mankind of a great part of the labour necessary to its subsistence, is the main cause of our present...
-
14. In testing the existence assertion, an auditor ordinarily works from the a. Financial statements to the accounting records. b. General journal to the general ledger. c. Supporting evidence to the...
-
Show the result of accessing the keys 3, 9, 1, 5 in order in the splay tree in Figure 4.72. 10 11 12 3 5 13
-
Consider the recursive algorithm in Figure 10.80 for finding the shortest weighted path in an acyclic graph, from s to t. a. Why does this algorithm not work for general graphs? b. Prove that this...
-
Show how to modify the topological sort algorithm so that if the graph is not acyclic, the algorithm will print out some cycle. You may not use depth-first search.
-
A second-order dynamic system is modeled as \[9 \ddot{x}+6 \dot{x}+\frac{10}{9} x=14 \delta(t), \quad x(0)=0, \quad \dot{x}(0)=-\frac{1}{4}\] a. Find the response \(x(t)\) in closed form. b. Plot the...
-
Consider a first-order system with time constant \(\tau\) and zero initial condition. Find the system's unit-step response for \(\tau=\frac{1}{3}\) and \(\frac{2}{3}\), plot the two curves versus \(0...
-
a. Identify the damping type and find the free response. b. Plot the free response by using the initial command. \(\ddot{x}+3 \dot{x}+4 x=0, \quad x(0)=\frac{2}{5}, \quad \dot{x}(0)=0\)
Study smarter with the SolutionInn App