Write a program to evaluate infix expressions

Assignment Help C/C++ Programming
Reference no: EM13320762

Prerequisites:

Before starting this programming assignment, participants should be able to:

Analyze a basic set of requirements for a problem

Compose C language programs

Create basic test cases for a program

Apply arrays, strings, and pointers

Summarize differences between array notation and pointer notation

Apply pointer arithmetic

Apply basic string handling library functions

Define and implement structures in C

Summarize the operations of a linked list

Describe the operations of a stack including: push (), pop (), peek () 

Overview & Requirements:

Write a program to evaluate infix expressions. An infix expression looks like the following:

9 * (5 - 4) + 2 / 6

This program must first convert the infix expression to a postfix expression, and then evaluate the postfix expression. A postfix expression for the above infix expression looks like the following:

9 5 4 - * 2 6 / +

For this assignment you will need to implement and apply one stack to convert from infix to postfix, and implement and apply a second stack to evaluate the postfix expression.

Please complete exercises 12.12 and 12.13 form your Deitel & Deitel C How to Program textbook. These exercises provide you with the algorithms required to perform the correct conversions and evaluations. Create a single program only, which combines both exercises. Also, be sure to allow the user to continue to enter infix expressions until they want to quit the program.

BONUS:

Provide appropriate test cases and drivers for each function in your stack application to receive up to 10 bonus points. For an additional 10 points allow for your program to accept multi-digit operands and unary sign operators (+ and -).

the assignment will be evaluated based on a successful compilation and adherence to the program requirements. We will grade according to the following criteria:

1) - Appropriate top-down design, style, and commenting according to class standards

2) - Correct stack function implementations

3) - Correct usage of infix stack

4) - Correct usage of postfix stack

Reference no: EM13320762

Questions Cloud

Calculate the net impulse : Calculate the net impulse delivered to a 138-kg quarterback initally running at 4.5 m/s if he's hit by a defending player and slowed to a speed of 1.1 m/s
Dealing with differnt stakeholder groups : Explain how ethics help managers determine the right way to behave when dealing with differnt stakeholder groups? Use Costco, General Electric, McDonald's and other businesses in your explanation.
What are the wavelengths of the first two overtones : We all sound like great singers in the shower, due to standing waves. What are the wavelengths of the first two overtones for this shower
How close should you come : You are trying to overhear a juicy conversation, but from your distance of 16.0m , How close should you come
Write a program to evaluate infix expressions : Write a program to evaluate infix expressions and summarize differences between array notation and pointer notation
Explain why the normal force the track exerts on the coaster : A roller coaster is riding along the rails at an amusement park. Explain why the normal force the track exerts on the coaster does zero work on it
What is the distance between blood sample and objective lens : To examine a particular blood sample in biology lab, a student uses a compound microscope set to have a magnification of -4530. What is the distance between the blood sample and the objective lens
Construct a ray diagram showing the location of image : An object is a distance 6f from a converging lens. construct a ray diagram showing the location and orientation of the image
Delegates to the national conventions : The primary election as a means of choosing the states’ delegates to the national conventions where the presidential nominee is formally selected

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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