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...
-
Why is the MPR for credit card receivable-backed securities important?
-
The vapor leaving the top of a distillation column goes to a condenser in which either total or partial condensation takes place. If a total condenser is used, a portion of the condensate is returned...
-
Products, geographic sites and businesses represent three objects for the collection, classification and communication of physical environmental information. Are these three objects related in any...
-
Ashton Fleming has decided to document and analyze the accounts payable process at S&S so the transition to a computerized system will be easier. He also hopes to improve any weaknesses he discovers...
-
Granite Furniture Store has the following sales forcast for the first 4 months of the year. In month one, Granite generated $45,000 in cash sales and $200,000 in credit sales. In month two Granite...
-
Angelo Ltd., a public company, had 600,000 common shares outstanding at the beginning of 20X4. On 1 March 20X4, Angelo purchased and retired 120,000 shares that had been owned by one of the company...
-
Why does Rosenberg recommend practicing in front of a mirror before breaking the news to the mother? Why is this better than practicing in front of her fellow doctors? Does it truly matter whether or...
-
The uniform rectangular relief gate AB has a weight of 8000 lb and a width of 4 ft. Determine the specific weight of the fluid if a minimum depth h= 5.626 ft of the fluid within the container is...
-
On February 1, 2024, Wolf Incorporated issued 10% bonds dated February 1, 2024, with a face amount of $240,000. The bonds sold for $287,503 and mature in 20 years. The effective interest rate for...
-
Ropalique is a popular clothing brand in the country Wesabania. The company wants to expand its market and decides to establish itself in the country Tristonville. To accomplish this, Ropalique...
-
The following selected transactions relate to liabilities of Rose Dish Corporation. Rose's fiscal year ends on December 31. 2024 February 3 Negotiated a revolving credit agreement with Second Bank,...
-
Teal Inc. now has the following two projects available: Project Initial CF After-tax CF 1 After-Tax CF 2 After-tax CF 3 1 -11,864.01 5,250 6,125 6,500 2 -3,336.42 3,750 3,150 Assume that R F =...
-
compare and contrast case study and surveys in psychology?
-
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.
-
The term azeotrope means (a) Condensing without changing (b) Boiling without changing (c) Both (a) and (b) (d) Neither (a) nor (b).
-
The bubble point and dew point curves meet where the mixture turns into (a) Purely two components (b) Purely one component (c) Purely three components (d) None of these.
-
The boiling point diagram of a binary solution is used to know how the equilibrium changes with (a) Pressure (b) Free energy (c) Temperature (d) Entropy.
Study smarter with the SolutionInn App