Skip to content

A simple calculator using imperative and object-oriented stack implementations

Notifications You must be signed in to change notification settings

kurt-bautista/stack-calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Stack-based calculator

Authors

  • Kurt Vincent Bautista
  • Julio Carlos Tomas Ledesma

CS 112 - Section B

Description

This simple stack-based calculator uses either an array-based or a linked list stack in performing expression evaluation. Input expression should be in postfix notation. Python 3 is required to run this program.

Usage

$ python calculator.py
OBJECTORIENTED, IMPERATIVE, QUIT: OBJECTORIENTED  # Create object-oriented calculator. Use IMPERATIVE for an imperative calculator. Enter quit to exit.
Enter postfix expression: 1 2 +  # 1 + 2
3  # Result

Supported operations

Operation Symbol
Addition +
Subtraction -
Multiplication *
Division /
Modulo %
Exponentiation **

About

A simple calculator using imperative and object-oriented stack implementations

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages