Due: Monday 09/16 10:00am
Note: Check your language in DrRacket. Go to the Language menu, select Choose Language, the first option is “The Racket Language”, Pick that one.
Write a Racket program that uses variables to run the following formulas with values of your choosing. This is what we did in class today with the pythagorean theorem.
- Example: Pythagorean Theorem
- Forumula: \(c = \sqrt{a^2 + b^2}\)
- Racket expression:
(sqrt (+ (* a a) (* b b)))
- Variables:
a b
- Program:
(define a 3) (define b 4) (sqrt (+ (* a a) (* b b)))
Create a single Racket file named work03.rkt
with the code for the three formulas below:
- Area of triangle:
- \[A = \dfrac{1}{2}bh\]
- Celsius to Fahrenheit:
- \[F = \dfrac{9}{5}C+32\]
- Gravity:
- \[G = \dfrac{m_1m_2}{d^2}\]