# RacketCalculator

Dylan Wetherald
James DeFilippo
December 7, 2014

## Overview

This is a basic calculator in Racket. It has a GUI, can do basic calculations, has minor graphing capabilities and can perform integration and differentiation.

## Screenshot ## Concepts Demonstrated

Utilized lists effectively to store information and move it around. Lambda usage all over the GUI. Implements map to convert between data types. Uses symbolic differentiation for calculus functionality.

## External Technology and Libraries

racket/gui racket/draw racket/gui/base plot

## Favorite Lines of Code

Each partner should identify a favorite line of code, Scheme expression, or entire procedure written by himself / herself in the entire project, and explain what it does. E.g.:

Dylan Wetherald: @@(define (evaluate expr)

```  (define r evaluate)
(match expr
[(and (? string?) (app string->number n))
n]
[(list "+" e1 e2)  (+ (r e1) (r e2))]
[(list "-" e1 e2)  (- (r e1) (r e2))]
[(list "*" e1 e2)  (* (r e1) (r e2))]
[(list "/" e1 e2)  (/ (r e1) (r e2))]
[(list "sqrt" e1)  (sqrt (r e1))]
[(list "expt" e1 e2)  (expt (r e1) (r e2))]
[_
(error 'evaluate "got ~a" expr)]))@@
```

This code takes a list of strings such as '("+" "1" "2") converts it out of being strings to '(+ 1 2) and then evaluates the expression.

• James DeFilippo:
```(define (integrate-input f a b s n)
(cond
[(string=? n "LEFT-RECTANGLE") (integrate f a b s left-rectangle)]
[(string=? n "MIDPOINT-RECTANGLE") (integrate f a b s left-rectangle)]
[(string=? n "RIGHT-RECTANGLE") (integrate f a b s left-rectangle)]
[(string=? n "TRAPEZOIDAL-RULE") (integrate f a b s left-rectangle)]
[(string=? n "SIMPSONS-RULE") (integrate f a b s left-rectangle)]
[else (displayln ("UNKNOWN-METHOD"))]
))
```

This function takes a function, limits of integration, step-size, and desired method of numerical integration and passes back the approximation of the integral.

## Technology Used Block Diagram

Create a simple block diagram of your software system that illustrates the major technical components and how they interact. Indicate which partner did which part of the work by putting an individual's initials inside the component(s) for which that person was primarily responsible. E.g.: 