Explain and evaluate post-fix expression

Assignment Help Programming Languages
Reference no: EM13936112

Many early calculators used a post-fix entry to perform arithmetic calculations. For example 2 + 3 in in-fix notation would be 2 3 + in post-fix notation. ( 2 + 3 ) * 4, would be 2 3 + 4 *. Utilizing a stack, post-fix expressions are very easily evalauted.

If an entry is numeric, simply push it on the stack. If an entry is an operator, pop the top two elements from the stack, perform the operation, and push the result on the stack. You must write a C# program that asks a user for input and evaluates an expression using this technique. For example:

Enter your post-fix expression: 5 6 + 4 5 * +

Answer: 31

 

Reference no: EM13936112

Questions Cloud

Perform a diagnosis of human process issues : An opportunity to contract to perform a diagnosis of human process issues at the interpersonal and group level in a large hospital system.
Describe benefits of code citations to avoid plagiarism. : Describe some benefits of code citations in addition to avoiding plagiarism.
Develop, evaluate and document a prototype website : Develop, evaluate and document a prototype website on the movie "one flew over the cuckoo's nest"
What is profit maximization rule for a two-plant monopolist : What is the profit maximization rule for a two-plant monopolist? Which of the following is a correct representation of a profit-maximizing monopoly earning positive economic profits?
Explain and evaluate post-fix expression : Many early calculators used a post-fix entry to perform arithmetic calculations. For example 2 + 3 in in-fix notation would be 2 3 + in post-fix notation. ( 2 + 3 ) * 4, would be 2 3 + 4 *. Utilizing a stack, post-fix expressions are very easily e..
Contemporary issues and events that impact young children : The information and knowledge that you gain from this course will help you develop five Action Plans (one for each week of the course) focused on responding to contemporary issues and events that impact young children
Microprocessors dominated the desktop computer market : Why do you think Intel microprocessors dominated the desktop computer market? Are they dominant in the mobile devices market? Explain your answer. (Use bullet points).
Calculate firms profit maximizing price : Suppose the firm decided to charge the (maximum) willingness to pay for each movie ticket? How many tickets would it sell now, and how much profit would it make?
Should you accept the offer or cash the canadian dollars : He is willing to buy your C$200 for 1500 New Pesos. Should you accept the offer or cash the Canadian dollars in at the airport? Explain.

Reviews

Write a Review

Programming Languages Questions & Answers

  Program to find real solutions

Method, which determines whether value of "b squared" - 4ac is negative. If negative, code then  prints out message "no real solutions" and returns from method.

  Write program which reads in side of a square

Write a program which reads in side of a square and then prints that square out of asterisks. Program must work for hollow squares of all side sizes between 1 and 20.

  Calculate the sum of squares of numbers using for loop

Given int variables k and total which have already been declared, use for loop to calculate the sum of squares of first 50 counting numbers, and store this value in total.

  Design logic that continuously prompt user for numeric value

Design the logic for a program that continuously prompts a user for a numeric value until the user enters 0. The application passes the value in turn to a method that squares the number

  Write down the xml file with markup tags

Write down the XML file with markup tags and some sample data to represent list of invoices. Write the XML tags for two invoices in list.

  Write a windows form program for a nina''s cookie source.

Include at least one other functional control such as a button (Exit button) or a MenuStrip having an Exit and an About selection.

  Design interactive program using prewritten methods

Design an interactive program that does the following, using the prewritten methods whenever they are appropriate. Prompt the user for and read a library card number, which must be between 1000 and 9999.

  Develop unix shell script to input number of hours

Develop a Unix shell script to input number of hours worked and pay rate and calculate the total pay, then the social security amount (assume 5%), then the net pay.

  Create method to generate random integers

Create a method named posNeg which generates 1000 random integers. Range of numbers must be from -5 to +5 inclusive.

  Write program to permit user to enter last names

Write down the program which permits the user to enter last names of five candidates in local election and number of votes received by each candidate.

  1 protecting the american food supply from terrorist

1. protecting the american food supply from terrorist attacks or natural contamination is a difficult task. the fda and

  Code the next version of the cp1200 catering calculator

You are to plan and then code the next version of the CP1200 catering calculator, as described in the following information and sample output

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