Validate the pairing of parenthesis in an expression

Assignment Help Programming Languages
Reference no: EM131148646

Programming Assignment - Palindromes & Parenthesis

Overview

You are to write two programs. One will validate palindromes; the other will validate the pairing of parenthesis in an expression. These programs must both use stacks. You can write either an array based stack, or a linked list to perform these tasks.

Details

These programs will require the implementation of a stack class. The stack class must minimally implement the following methods: push, pop, clear, isEmpty, and stackTop. Additionally each program will require a user interface to allow the entry of the required string data. The logic for the two programs is as follows:

Palindromes

Palindromes are sentences that spell the same forward as they do backward (irrespective of case, spaces, and punctuation). You need to pull each letter off a string, upper case it, and push it on the stack. While you do this build a string that contains the pushed letters in their original order (minus punctuation). When you are done, popping the data off the stack should equal the original string.

After processing a palindrome output whether it is or is not a palindrome.

Parenthesis

Verify that the number of left and right parenthesis is correct. Push left parenthesis onto the stack, pop off a parenthesis when you get a right parenthesis, on underflow you have too many right parenthesis, if you get to the end of the string, and the stack is empty, the parenthesis match, if it is not empty there are too many left parenthesis.

Display the status after processing a string.

Reference no: EM131148646

Questions Cloud

What would you expect would happen to the cost of equity : What would you expect would happen to the cost of equity if you had to raise it by selling new equity, and why? If the after-tax cost of debt is always less expensive than equity, why don't firms use more debt and less equity? What are some of the..
Discuss how energy is stored in capacitors and inductors : Discuss how energy is stored in capacitors and inductors. Are the equations linear or non-linear? How do you know? Discuss the concept of duality and why it applies to many fundament engineering concepts.
Describe the type of common chemical hazards : Describe the type of common chemical hazards that are present in your local environment, similar to those illustrated in the Tox Town interactive.
What can airlines do to improve customer experience using it : What can airlines do to improve the customer experience using IT? Explain how you would use IT to decrease wait times at TSA security lines.
Validate the pairing of parenthesis in an expression : You are to write two programs. One will validate palindromes; the other will validate the pairing of parenthesis in an expression. These programs must both use stacks. You can write either an array based stack, or a linked list to perform these ta..
Compute the break even sales : ompute the break even sales (units). - How many units of each product, MP3 players and satellite radios, would be sold at the break even point?
Describe how electric current is generated and transported : Describe how an electric current is generated and transported. Assess the current state of our national grid in the United States, as well as any challenges in updating this grid.
Identify a general plan to recover from the incident : Identify additional software that will be required to monitor the network and protect key assets. Identify any security controls that need to be implemented to assist in mitigating risks. Mitigate all of the risks that were identified during the asse..
Describe the differences between temperature and heat : Describe the differences and similarities between temperature and heat. Analyze how heat transfer occurs during the processes of conduction and convection. Provide an example of where each occurs in natural physical systems.

Reviews

Write a Review

Programming Languages Questions & Answers

  Set fs script before processing records

Set FS script before processing records. This is also a good place to set up an array of month names in chronological order - you want to try sorting the catagory section.

  Html5 browsers will support the following new technology

HTML5 browsers will support the following new technology. o CSS 2 o PDF 10.2

  How is active directory implemented?

How is Active Directory implemented?

  Comment on the performance of your system

E91: Humanoid Robotics - Spring 2013 - Assignment 2. Produce a webpage demonstrating your program. Provide images of your humanoid model in a neutral pose, several (at least 2) random unstable poses, several random stable poses. Comment on the per..

  Write the code for the countwords function

Write the code for the countWords function (you can assume that the line begins with a letter, that each word is separated by a single space and that the line ends with a period.

  Describe benefits of code citations to avoid plagiarism.

Describe some benefits of code citations in addition to avoiding plagiarism.

  Constructors need to be declared for each class.

Hi, I need helping figuring out the following questions. I need to identify the following statements as either true or false. If an answer is true, I need to explain why and, where appropriate, provide an example. If the answer is false, I also ne..

  Based on the keston 2013 article in the electronic reserve

write a 200- to 300-word short-answer response to the followingbased on the keston 2013 article in the electronic

  Payroll program for a large organization

You have been tasked with building a payroll program for a large organization with offices spread across the United States. The company has one larger data center that each office connects to via a wide area network (WAN)

  Pseudocode to read in data file containing student names

Read in a data file containing student names, ID number, and gender into an array. Print the contents of each record using the array.

  Matlab integration techniques

Use MATLAB integration techniques to determine the total Axial Elongation and explain the theory of Simpson 1/3 rule for integration in detail. Use appropriate examples to demonstrate how it works and how the integration result is computed.

  Applying constraints in program

You will require to set up constants in program for given: number of square feet per square yard.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd