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

  Decisions & conditions

Decisions & Conditions

  Describing program using suiatble printf command

Yyou have to describe all of this to user using suiatble printf() statements.

  Write a function prime that takes a single integer

Write a higher order function list To that takes a function f and a number n and uses list comprehension to return a list of all the numbers from 1 to n for which the function f evaluates to True.

  Write program to accept number from user-fibonacci series

Write a program that accepts a number 'n' from the user and generates Fibonacci series till n (Fibonacci series starts with 0 and 1.

  Describes an accusation of fact that a crime

Describes an accusation of fact that a crime has been committed.a. attrition

  Write and debug a mips program

Write and debug a MIPS program that performs the given operations - Display one of the following statements depending on if a>b, or a=b or a

  Probability line is executed in nth iteration of for loop

What is the probability that line is executed during the nth iteration of the for loop? What is the exact expected number of executions of line?

  How prospectors get through mine shaft only fifteen minutes

How can all four prospectors get through mine shaft in only 15 minutes? After you have solved this problem, describe how you got your foot in door.

  Write a ruby program with the following specification

The second smallest number in the list, along with its position in the list, with 1 being the position of the first number.

  Design a class named rectangle to represent a rectangle

(The Rectangle class ) Following the example of the Circle, design a class named Rectangle to represent a rectangle. The class contains: Two double data fields named width and height that specify the width and height of the rectangle. The defa..

  How many scores they will enter

Because all users may not have 10 scores and we want to keep the scores they entered for use at a later date, the above program will have to be modified to add a menu that lets the user decide how many scores they will enter

  Develop two packages to accept information

Develop two packages, package1 comprises two classes manager and clerk.both classes having method to accept corresponding information.packages.

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