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

  Program to check compatibity for matrix multiplication

Write down program in C++ for matrix multiplication. Program must accept dimension of both matrices to be multiplied and check for compatibity.

  Write a linked-list-based push-down stack implementation

Write a linked-list-based push-down stack implementation that keeps items on the list in order from least recently inserted to most recently inserted. You will need to use a doubly linked list.

  Write down a program which will calculate and displays min

write down a program which will calculate and displays the min temperature and the maximum temperature for seven days of a week.

  Write a program in which the user is prompted

Write a program in which the user is prompted for the number of values that they will be entering. The user then enters that number of integers into an array

  Write in c++ another overloaded operator

Write in C++ another overloaded operator to go in the program that has Treasury. Overload the forward slash /  so that in the main program, you can declare sale to be of type Treasury, and commission to be of type Treasury, and commispctage to be of ..

  How would you put a empty space between output

How would you put a empty space between output, right now it prints 6 rows but how do i add a space or a "\n" for example row1 row2 row3

  The imperial system of measurements

The Imperial system of measurements uses feet and inches for length, where 1 foot is equal to 12 inches. Write a class named Imperial that will represent distance measurements in feet and inches. Your class should include the following.

  Write a program to convert between rectangular

Write a program to convert between rectangular and cylindrical coordinates, based upon user input. For example, if the user wants to convert cylindrical to rectangular coordinates, the user would input r, ?, z values and the program would output x, y..

  Design a cruiseship class that is derived from ship class

SEN 970 Object-Oriented Programming in Objective-C. Demonstrate the classes in a program that has an array of ship pointers. The array elements should be initialized with the addresses of dynamically allocated Ship, CruiseShip and CargoShip objects..

  Write a loan calculator program

Write a loan calculator program in C++ that displays monthly balances for user-specified loan terms. To be flexible, you decide to specify the loan terms in a file and provide that filename  entered from the keyboard. To keep things simple

  Design is known, what advantages does keeping

Given that the design is known, what advantages does keeping the source code unavailable give the company and those who purchase the software? What disadvantages does it cause?

  Windows application that function like a banking account

Create a Windows application that function like a banking account register. Separate the business logic from the presentation layer. The graphical user interface should allow user to input the account name, number, and balance.

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