Calculator

From UBC Wiki

Symptom Analyzer

Authors: Brendan, Leann

What is the problem?

State the general problem. If applicable, tell us what information you will use, e.g., a link to some web site that provides the information you used. What will you do?

Inspired by the simple symbolic algebra system that manipulated algebraic expressions in Assignment 5, we would like to attempt to create a simple calculator that will perform basic arithmetic. Some of these operations include...

  • Addition/Subtraction.
  • Multiplication/Division.
  • Perhaps Modular Arithmetic.

The catch is, you will be able to do these operation to numbers in three different bases.

  1. Binary (Base 2).
  2. Hexadecimal (Base 16).
  3. Decimal (Base 10).

The user will be prompted at the start which base they would like to operate in, then be given the option to perform any of the arithmetic operations on any two numbers. We could extend this implementation to any amount of numbers if all goes well.

What is the something extra?

The "something extra" we would like to do is allow the user to choose any base number to work with, instead of the three we give them. They may also be able to perform the operations on two numbers in different bases, producing an answer in a base they can decide on as well.

What did we learn from doing this?

(This should be written after you have done the work.) What is the bottom-line? Is functional programming suitable for (part-of) the task? Make sure you include the evidence for your claims.

Links to code etc