Preview

Dissertation for Desk Calculator

Better Essays
Open Document
Open Document
1838 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Dissertation for Desk Calculator
Desk Calculator

BIRLA INSTITUTE OF TECHNOLOGY & SCIENCE, PILANI
WORK INTEGRATED LEARNING PROGRAMMES DIVISION
BITS-WIPRO Collaborative Programme: MS in Information Technology, YEAR-2012.

Abstract: The project is to solve an infix expression using a desk calculator. Input is given as an infix expression and output is obtained in a text file. Method followed to solve the expression is, the input is fetched from the input text document and converted to postfix notation using expression tree data structure, the resulted RPN expression is evaluated and the result is shown in output text file. Infix is converted to postfix because, it is easy for the compiler to execute the expression in postfix format. Commonly used data structures for evaluating expressions are stacks and expression trees, both of the above data structures are analyzed and concluded that expression trees are the best suited data structure for solving infix expression.

1.Introduction:

Consider a situation where you are writing a programmable calculator. If the user types in 10 + 10, how would you compute a result of the expression? You might have a solution for this simple expression. But what if he types in 3 * 2 / (5 + 45) % 10 ? What would you do then?

The expression that you see above is known as Infix Notation. It is a convention which humans are familiar with and is easier to read. But for a computer, calculating the result from an expression in this form is difficult. Hence the need arises to find another suitable system for representing arithmetic expressions which can be easily processed by computing systems. The Prefix and Postfix Notations make the evaluation procedure really simple. The calculator you will be working with uses Reverse Polish Notation (RPN), which avoids the ambiguities that can be caused by operator precedence and



References: [1] B. B. Welch. Practical Programming in Tcl and Tk, 3rd ed. 2000. [2] J. Zelle. Python Programming: An Introduction to Computer Science. 2004. [3] http://cplusplus.com/reference/stl/stack/ [4] http://www.drdobbs.com/184401948 - UML for C programming.

You May Also Find These Documents Helpful

  • Satisfactory Essays

    USA TEST PREP ANSWER MATH

    • 1491 Words
    • 6 Pages

    This property allows you to change the order of the terms when adding OR multiplying without changing the outcome.…

    • 1491 Words
    • 6 Pages
    Satisfactory Essays
  • Satisfactory Essays

    cout << "Select the operator you want to work (+ for addition, - for subtraction , * for multiplication , / for division):- ";…

    • 426 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    There is nothing wrong with this discussion question response. Accordingly, I awarded the author a score of 10. Each paragraph is written to explain each operator. Clearly, this is good writing. Each paragraph uses vocabulary from the reading material, and gives insight into the operation of each operator. This response explains the unary operator “++” is used for adding one to a variable, the conditional-and-operator “&&” is used between testing expressions, the inequality operator ”!=” is used to rule out a possible value, and the “%=” operator is used to return the remainder of a division operation( to the variable to the left of this assignment operator ). Thank…

    • 110 Words
    • 1 Page
    Satisfactory Essays
  • Satisfactory Essays

    Homework Unit 3

    • 354 Words
    • 2 Pages

    4. AND operator- combines more than one condition in a program. Makes a compunf Boolean operation.…

    • 354 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    CIS115 W2 Exercise

    • 757 Words
    • 10 Pages

    TCO 2—Given a simple problem, design a solution algorithm that uses arithmetic expressions and built-in functions.…

    • 757 Words
    • 10 Pages
    Good Essays
  • Satisfactory Essays

    PT1420week5exdkinney

    • 404 Words
    • 2 Pages

    VB supports many mathematical and/or numeric functions that can make calculations and other procedures very simple, as one just have to feed in the variables, and get the output after the function processes it. One such function is:…

    • 404 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    Ap Calculus

    • 2722 Words
    • 11 Pages

    | The symbols +, -, *, /, %, and ^ used to denote addition, subtraction (or negation), multiplication, division, percentage, and exponentiation in an Excel formula.…

    • 2722 Words
    • 11 Pages
    Powerful Essays
  • Good Essays

    recognise integers as positive or negative whole numbers, including zero work out the answer to a calculation given the answer to a related calculation multiply and…

    • 1910 Words
    • 8 Pages
    Good Essays
  • Good Essays

    -When addition or subtraction is performed, answers are rounded to the least significant decimal place.…

    • 2130 Words
    • 9 Pages
    Good Essays
  • Satisfactory Essays

    7. A user has opened a calculator application, typed the numbers 123456789, and then done some math problem using…

    • 418 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Resolute desk

    • 535 Words
    • 3 Pages

    While I was visiting Ronald Regan Presidential Library the most impression on me was left by resolute desk. The Resolute desk is a big, nineteenth-century partners' desk frequently chosen by presidents of the United States for use in the White House Oval Office as the Oval Office desk. It was built from the timbers of the British Arctic Exploration ship Resolute and it was a gift from Queen Victoria to President Rutherford B. Hayes in 1880.…

    • 535 Words
    • 3 Pages
    Good Essays
  • Good Essays

    Doc. Unix

    • 1228 Words
    • 5 Pages

    b. It is used to perform division on the results of a numerical command operator.…

    • 1228 Words
    • 5 Pages
    Good Essays
  • Satisfactory Essays

    The expression 1 To 5 in the Case 1 To 5 clause specifies the range of numbers from ____.…

    • 595 Words
    • 3 Pages
    Satisfactory Essays
  • Better Essays

    Modeling is the process of creating a simplified representation of real life problems and representing them in an organized fashion in order to understand a particular problem. These models can take many forms such as mental, visual, mathematical or electronic spreadsheets to name a few. Their uses can be seen in almost every field of our daily lives such as businesses, governments, human resources, science and engineering, and medicine etc. Their primary function is to gain insight into a specific problem and after getting a clear understanding of the topic, one can easily approach it from different directions with possible solutions. This paper discusses this process in detail, starting with gaining insight into a specific problem by using a problem solving model, and then moves on to how it applies to spreadsheet modeling. It also discusses different aspects of electronic spreadsheet engineering, its uses and caveats, as well as its dependency in the business world these days.…

    • 2313 Words
    • 10 Pages
    Better Essays
  • Good Essays

    Constructing an expression tree from a postfix expression: read one symbol at a time; if operand, create a one-node tree and push it onto a stack. If operator, pop two trees T1, T2 from stack, and form a new tree whose root is the operator, and whose left and right children are T2 and T1; push new tree onto stack…

    • 1611 Words
    • 7 Pages
    Good Essays

Related Topics