Program that reads expressions over binary operators

Assignment Help Basic Computer Science
Reference no: EM13856796

Write a program that reads expressions over binary operators +, -, *, /, ^ and parenthesis from the standard input and displays the result of evaluating the input expression to the standard output. The program must first read the priorities and associativities of each operator from the standard input. For example the following input lines describe the standard priorities and associativities

- 1 L
+ 1 L
* 2 L
/ 2 L
^ 3 R

  • Each expression is terminated by a new line
  • Operands are all integers and all operators perform integer operations
  • Your program must display an error message in case of an erroneous expression and continue to the next expression
  • The end of input is signaled by end of file (CTRL D) The program must be completed using algorithms discussed in class (using a stack that is implemented with pointers). Other methods (and possibly correct) programs will not be considered correct!!

Attachment:- projectAlgorithm.txt

Reference no: EM13856796

Questions Cloud

Hand tracing table : Hand Tracing Table: Please complete the follow Hand Trace Tables. Using MS Word insert the table with proper numbers of columns and table header, below the "Hand Tracing Table Goes Here:" (2 points each, 8 points total).
What is the relationship between risk and expected return : What is risk? What is the relationship between risk and expected return? Describe and discuss the role of the investment banker. When is a syndicate formed and what is the purpose?
What are the key components of creating a project plan : Describe the overall purpose of the Planning Actions. What are the key components of creating a Project plan?
Consultant air focuses business on high-paying : Consultant Air focuses business on high-paying McKinsey consultants, but to fill planes, it also carries the general public. It is flying a 100-seat jet from Atlanta to San Francisco and the consultant demand is normally distributed with mean 65 and ..
Program that reads expressions over binary operators : Write a program that reads expressions over binary operators +, -, *, /, ^ and parenthesis from the standard input and displays the result of evaluating the input expression to the standard output. The program must first read the priorities and as..
What planning methods would you use to develop business : What planning methods would you use to develop business/ IT strategies and applications for your own business? What are the three most important factors you would use in evaluating computer hardware? Computer software?
What the technology costs to the actual payback in equity : What the technology costs to the actual payback in equity at a given ratio i.e., years at x amount of dollar for total shares.
What is unit margin for a bottle of wine for the wine maker : A Virginia wine maker faces a variable cost of $6.75 per bottle, and makes a 50% margin when selling to a wholesaler. The wholesaler obtains a 25% margin by simply reselling to wine stores. Wine stores get a 40% margin on wine sold to consumers.  Wha..
Decide the troubleshooting methodology that you would use : Write a two to four (2-4) page paper in which you: Decide the troubleshooting methodology that you would use for each issue. Provide a rationale to support your response

Reviews

Write a Review

Basic Computer Science Questions & Answers

  What are some other uses for the break statement

How about using a break in a switch statement, show how you can really have a problem if you skip the break statement in a switch.

  Level-order traversal of the red-black bst

What is the level-order traversal of the red-black BST that results after inserting the following sequence of keys:

  Methods for communication

You will submit a two-part document. In the first part, you will submit a written report in which you select the methods for communication and collaboration that best fit your area of focus and implement them as a training tool for your new Techni..

  Use a cluster architecture to provide rapid scalability

Describe how you might use a cluster architecture to provide rapid scalability for a Web-based company experiencing rapid growth?

  For this assignment we will focus on different tools and

for this assignment we will focus on the various tools and techniques available to the security professional in order

  Massively multiplayer online role-playing games

In a virtual world (VW) of massively multiplayer online role-playing games (MMORPGs), collaboration and communication are provided through the Internet between MMORPG-ready devices such as the Microsoft Xbox, and Sony PlayStation, and by using the..

  Calculate and output the mean and median of collected data

Design a program that will allow some number of grades (up to a max of 100) to be input by the user. After the data has been collected, your program should calculate and output the mean and median of the collected data, as well as the sorted grade..

  Amusement park programming project

1. Use the Java selection constructs (if and if else). 2. Use the Java iteration constructs (while, do, for). 3. Use Boolean variables and expressions to control iterations. 4. Use arrays or ArrayList for storing objects. 5. Proper design techniques.

  Write a python function celcius fahrenheit

Write a python function celcius_fahrenheit wich takes temperature values from a list and changes them into fahrenheit values.

  Dynamic programming

Please provide with a detailed answer using DYNAMIC PROGRAMMING

  Discuss insertion and deletion and modification anomalies

Discuss insertion, deletion, and modification anomalies. Why are they considered bad. Illustrate with examples.

  Excavated material to the structural fill location

How many dump truck loads, given a dump truck with 18 LCY capacity, will be required for hauling the excavated material to the structural fill location?

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