CMSC 208
Spring 2016
02/10/2017
Programming with Racket
Due: Friday, February 17
beginning of class (3pm)

For this assignment, you may work in pairs (no groups of 3 or more will be permitted).    
By putting more than one name on the assignment, you are stating that both people contributed significantly to each part.


Assignment:  

0)   You may find the examples done in class  on the server by executing the command:

cp -r   ~scottmce/208files/inclass.scm    .

Note the period at the end of the previous line.   


yellow separator
1)  Your task is to create a file called RacketFunctions.rkt   that contains a definition for each of the following functions:

a)  
  • Name:   quadraticRoot
  • Parameters:   3:    a,  b,  c    (numbers)
  • Returns:    The positive root of the quadratic equation defined by :
quadPos


b)  
  • Name:   countDown
  • Parameters:   1 (an integer)
  • Returns:   a list of the numbers counting down from that integer followed by the word BLASTOFF
EG:   countDown(4)    should return   ( 4  3  2  1  BLASTOFF)
c)  
  • Name:   howManyPositive
  • Parameters:   1 (a list of numbers)
  • Returns:    how many of the numbers are bigger than 0

d)  
  • Name:   allPositive
  • Parameters:   1 (a list of numbers)
  • Returns:    true if the list contains all positive numbers, false otherwise
e)
  • Name:   only positive
  • Parameters:   1 (a list of numbers)
  • Returns:   a new list of numbers that contains only the numbers in the argument that are positive
yellow separator
2)   Get the file   RacketTester.rkt     (This will be posted at noon on Monday, Febraury 13)

cp -r   ~scottmce/208files/RacketTester.rkt    .
Note the period at the end of the previous line.  

yellow separator
3)  Testing:
Go into Racket and enter:

(load "RacketFunctions.rkt")

This should load your functions.

Then:
(load "RacketTester.rkt")

This should run the tester.    It is up to you to determine if the tester is working correctly.     You are welcome to modify the tester file.


To get out of the Racket software gracefully:
(exit)

yellow separator


4)
 Put a comment at the top of the file stating:
  • your name(s)
  • any sources of help you received
  • a list of any bugs you believe your functions have (if there are no bugs, state this)

Handin:

THIS WILL NOT BE AVAILABLE UNTIL TUESDAY, FEBRUARY 14 at 12 noon.
Use the following handin script to submit your file:

handin cmsc208  labracket   RacketFunctions.rkt