Write a program to evaluate infix expressions

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

 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 -).

Reference no: EM13499401

Questions Cloud

What kind of psychology research method : What kind of psychology research method would be used in learning about your personal family health history?
Generate a random number : Generate a random number between 1 – 5 and 3 – 8 for express and normal lanes, respectively. This represents the arrival time of the first customer into each lane. Set the variable for total time elapsed to 0.
Individual psychotherapy : Individual Psychotherapy, describe the basic function and premise of each one on a child’s recovery. Use outside sources to support your answers.
Contributes to healthy-maladaptive psychological functioning : Pick a part of the brain and discribe how it contributes to healthy and maladaptive psychological functioning. Be sure to include examples to support your descriptions.
Write a program to evaluate infix expressions : Write a program to evaluate infix expressions. An infix expression looks like the following:   9 * (5 - 4) + 2 / 6
An assessment of your mental health status : An assessment of your mental health status...are there things you are currently doing that you have found contribute to good mental health? What are things you could add to your personal mental health regimen as a result of content from psychology.
Importance of nutrition during the infancy : Importance of nutrition during the Infancy and Toddler-hood period. Summarize pediatric recommendations regarding early feeding and the introduction to cow’s milk and sold foods, the dangers of malnutrition, and cite factors that contribute to ob..
Stress causes-stress effects and management : In a seperate paragraph for each what is (1)Stress Causes, (2) Stress Effects, and (3) Stress management and the 4) is indicate what your stress signs are....and what your favorite stress relief strategies are....
Cognitive development in middle childhood : Explain and analyze one of the approaches to cognitive development in middle childhood.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Program that compares the number of possible sequences

Write a c++ program that compares the number of possible sequences of the length L that can be generated. The program must output a formatted list comparing the number of possible sequences for L=5,6,7,8,9. given size N=9

  C is a general-purpose programming language designed as an

c is a general-purpose programming language designed as an improvement to the c programming language. in short the

  The staffs need a program that can determine

The staffs need a program that can determine whether children have been naughty or nice. individual data files(can be any name) for each childred are available that consist of 368(365+3)integer number each.

  Write a c program that reads in five numbers

Q1. (Bar Chart /Histogram printing) Write a C program that reads in five numbers (each between 1 and 30). For each number read, your program should print a line containing that number of adjacent asterisks. For example, if your program reads the numb..

  Main function to input twenty integers in given range

Write a main function to input 20 integers in range of 1-6, function should count number of times the numbers 2 and 5 occur. function must declare statics variables count2 and count5.

  Print each employee''s identification number

1) in a program you need to store the identification numbers of 10 employees (as ints) and their weekly gross pay (as doubles) A) Define two arrays that may be used in parallel to store the 10 employee indentificcation numbers and gross pay amounts B..

  Write c program for linked list applications

Write a complete C program which illustrates the Linked list applications data structures and algorithms. The program will read in mid-semester test scores as Main Linked List and produce six outputs:

  How to compile your program

how to compile your program (including the actual compile command) and how to run it (including command line arguments, if any) A description of your solution to these two problems, including what you did to solve the problem, and why you did it that..

  Make a program to play lottery

make a program to play lottery. The program randomly generates a Lottery of a three-digit number( any number from 100 to 999), prompts the user to enter a three-digit number, and determines

  Wrie a program that will generate a list of 10000 numbers

Wrie a program that will generate a list of 10000 numbers stored in an array with values 1 and 500.Print out any original 200 numbers to show the results(not one number per line either).Now sort the number using bubble sort

  Write a program using vectors and iterators

Create a program that uses at least two functions that will be called from your main. This program is a number game program that asks for parts of your phone and after manipulating it mathematically, eventually outputs your entire phone number. The d..

  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.

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