Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Before attempting to assist, please make sure you read all items below - PREVIOUS RESPONDENTS HAVE BEEN WRONG. 1. This is a JSFiddle Assignment so

Before attempting to assist, please make sure you read all items below - PREVIOUS RESPONDENTS HAVE BEEN WRONG.

1. This is a JSFiddle Assignment so this needs to be written at THE WEBSITE: jsfiddle.net with both the HTML and Java script included.

2. Implement a Stack in Javascript. Do not use an array as the stack or in the implementation of the stack. Repeat You MUST implement the Stack (start with your linked list) DO NOT USE AN ARRAY.

3. You will build a Stack Computer from your stack.

4. When a number is entered it goes onto the top of the stack.

5. When an operation is entered, the previous 2 numbers are operated on by the operation and the result is pushed onto the top of the stack. This is how an RPN calculator works. For example: 2 [enter] 2 5 [enter] 5 2 * [enter] * 5 2 -> collapses to 10 would leave at 10 at the top of the stack.

6. The program should use a simple input box, either a text field or prompt and display the contents of the Stack.

7. Building A Stack is relatively easy if you have built a List. A Stack is nothing more complex with 2 extra functions added Push(_value) and Pop(). The Push function obviously needs an argument _value. The Pop function should always return the element on the top of the stack and at the same time removing it from the top of the stack.

8. Implementation of a Stack using an array will not be accepted (no grade will be assigned). A stack computer created using a Stack (with correct push and pop) that performs all operations correctly and does not allow bad entries (non-numeric or operation, no operations until 2 numbers on stack).

9. Use nodes, pop and push functions.

**Please show code and an example of successful output**

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

Icdt 88 2nd International Conference On Database Theory Bruges Belgium August 31 September 2 1988 Proceedings Lncs 326

Authors: Marc Gyssens ,Jan Paredaens ,Dirk Van Gucht

1st Edition

3540501711, 978-3540501718

More Books

Students also viewed these Databases questions

Question

Language in Context?

Answered: 1 week ago