2015-09-30 Lab02

posted Sep 30, 2015, 5:30 AM by Samuel Konstantinovich   [ updated Sep 30, 2015, 7:41 AM ]
Goal: Lab02

Do Now:

On paper while you log in:
Define a function in scheme (double n) that evaluates to twice the value of the parameter.
(double 3) results in 6
(double 2.1)  results in 4.2

Pre-Lab: 

1. Write down the quadratic formula in your notebook. Circle the discriminant. See if your neighbors agree with you.

2. Give 3 examples of quadratic equations and their solutions. (You can use the formula, or any other method)


Lab02:

You are writing two functions:

1.  posRoot(a b c) -- return one of the roots of the quadratic:

ax^2 + bx + c = 0 
when using the quadratic formula you use the + operator


2. negRoot(a b c) -- return one of the roots of the quadratic:

 ax^2 + bx + c = 0 

when using the quadratic formula you use the - operator


Now: Make some test cases so you know if your functions work. 

Comments