hw1 - CSE 4301/5290 Homework 1 Due: September 14, Wed, 5pm;...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
CSE 4301/5290 Homework 1 Due: September 14, Wed, 5pm; Submit Server: class = ai , project = hw1, one single file 1. Write a function positive-count that returns the num- ber of positive numbers; return nil if the list is empty or has any non-numbers. 2. (updated) Using the wind speed of storms: ((name-1 speed-1) . .. (name-n speed-n)) as an argument, write LISP functions storm-categories to generate cat- egory names (39-73 is Tropical-Storm, 74-95 is Hurricane- Cat-1, 96-110 is Hurricane-Cat-2, 111-130 is Hurricane- Cat-3, 131-155 is Hurricane-Cat-4, and 156 or higher is Hurricane-Cat-5) and storm-distribution to calculate the number of storms in each category. You may assume the speed values in the argument list are integers with value 39. > (defconstant *storms2004* ’((bonnie 65) (charley 150) (frances 145) (ivan 165) (jeanne 120) )) *STORMS2004* > (storm-categories *storms2004*) ((BONNIE TROPICAL-STORM) (CHARLEY HURRICANE-CAT-4) (FRANCES HURRICANE-CAT-4) (IVAN HURRICANE-CAT-5) (JEANNE HURRICANE-CAT-3))
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/10/2012 for the course CSE 4301 taught by Professor Chan during the Spring '09 term at FIT.

Ask a homework question - tutors are online