Program to evaluate postfix expressions

Assignment Help Other Subject
Reference no: EM13204579

Write a program to evaluate postfix expressions containing complex numbers using a stack. The algorithm for evaluating a postfix expression requires a stack of complex numbers. The pseudocode for evaluating postfix expressions is given below:

while not end of expression

switch next token

case complex number:

push the value onto the stack

case operator:

pop two operands from the stack

evaluate operation

push result onto the stack

pop the final result off the stack

Each complex number will all be enclosed in a pair of parentheses. The operators permitted include +, - and *. You may assume that all expressions are syntactically correct. 
The user should be allowed to enter and evaluate any number of expressions.

Reference no: EM13204579

Questions Cloud

Developmental life stage or phase : Why does the chosen theory appeals to you, and relate it to a developmental life stage or phase? Examples of life stages or phases may include marriage, parenthood, career, a return to school, empty nest, grand parenting, etc.
Find the length of each side : the perimeter of a triangle is 195mm.if the lengths of the sides are consecutive odd integers, find the length of each side.
Freezing temperatures : what are the two types of tundra and why do they have below freezing temperatures throughtout most of the year?
What is the size of the population after hours : A certain bacteria population is known to quadruple every 150 minutes. Suppose that there are initially 120 bacteria.
Program to evaluate postfix expressions : write a program to evaluate postfix expressions containing complex numbers using a stack. The algorithm for evaluating a postfix expression requires a stack of complex numbers.
What do you think about cooperative breeding : What do you think about cooperative breeding and when is it advantageous to be a helper to your kin versus going off to try and breed yourself?
Describe the crowding-out effect of an increase in govt : Describe the crowding-out effect of an increase in government purchases. Why does the magnitude of the crowding-out effect depend on how responsive interest rates are to increased government borrowing and how responsive investment is to changes in..
What would happen to autonomous consumption : What would happen to autonomous consumption if household debt fell and the interest rate rose over the same time period What would happen to autonomous consumption if real wealth increased and expectations of the future became more optimistic
How do the decisions differ between capitalist and socialist : What motivated the producers of all the individual products in the store to make them and offer them for sale? How did the producers decide on the best combinations of resources to use Who made those resources available, and why

Reviews

Write a Review

Other Subject Questions & Answers

  Three features of our constitutional system

Discuss two to three features of our constitutional system that render it difficult to change. Explain how stability might impede progress and give a government example.

  The hudson engineering group

The Hudson Engineering Group(HEG) has contacted you to create a database for its training program. The HEG has several instructors, and offers advanced technology courses, each of which may be taught several times a year.

  Margaret is passionately committed to animal rights

Margaret is passionately committed to animal rights. At an evening lecture required for her biology class, she learned that the title of the speaker's talk was "The Importance of Animal Experimentation to Medical Advances."

  Disciplines or vocations-spiritual leadership

One model of leadership that is being adapted by many organizations and disciplines or vocations is spiritual leadership.

  Unum decided it needed a data warehouse

Refer to IT’s About Business 4.2. Unum decided it needed a data warehouse for all of the following reasons except :

  Healthy baby

There are numerous things that pregnant women should and should not do to have a healthy baby. Pick one and explain why it is so important. Please answer in 160 words or less and include the url or reference used.

  Explaining the contract administration and change issues

How would one explicate and evaluaate the importance of roles and responsibilities of contracting officers and administrator? How would one explicate and evaluate the importance of improving methods of creating contract schedules?

  Forgetting and remembering develop-influence adult memories

Discuss the manner in which forgetting and remembering develop and influence adult memories. What might interfere with this development? How does this development affect clients and what problems might you see in working with clients?

  Analyze biological basis to influence other family members

Analyze biological basis for and explain how choices for care might influence other family members with respect to their individual problems, if at all.

  Functional aspects for the quality of bread

Ingredients are functional aspects for the quality of bread (texture, structure ,color, volume, flavor, shape). What are the ingredient functions (control, low-gluten, flour type, sugar function, fat function, salt function) of a standard cake?

  Website effectiveness-usability and suitability

Create criteria that can be used to evaluate websites based on how effective they are, how easy they are to use, and whether or not they are suitable for their intended purpose and audience.

  Shortage of resilience research on canadian aboriginals

Write an essay of 500-750 words. Be sure that you are presenting the concepts in your own words and that you include current information.

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