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

    6. And operator - If the number is not within the range then it comes back false.…

    • 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

    En1320 Unit 1 Research Paper 1

    • 27742 Words
    • 111 Pages

    write back the result to memory. The complete assembly program to compute the value of…

    • 27742 Words
    • 111 Pages
    Powerful 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

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

    • 2130 Words
    • 9 Pages
    Good Essays
  • Good Essays

    notes

    • 1649 Words
    • 7 Pages

    The following list of questions has been developed as a supplement to the Course of Study and Learning Resources for CGC1 and or ATO1. As you begin working through the textbooks try to answer the questions below in detail. This will provide you with a note-taking tool and a review document at the end or your studies.…

    • 1649 Words
    • 7 Pages
    Good 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

    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
  • Powerful Essays

    Nt1110 Unit 3 Assignment

    • 479 Words
    • 2 Pages

    Modern electronic calculators contain a keyboard with buttons for digits and arithmetical operations. Some even contain 00 and 000 buttons to make large numbers easier to enter. Most basic calculators assign only one digit or operation on each button. However, in more specific calculators, a button can perform multi-function working with key combination or current reckoning…

    • 479 Words
    • 2 Pages
    Powerful Essays

Related Topics