Lab F -- In-lab topping off exercise F

CISC 280 Program Development Techniques

Module F topping off exercise topperF4:

Business Unlimited has a lot of record in the form of lists. In these lists the first entry is identifying information and the other entries are numbers. For example the list might be a customer record and the numbers are the amounts of transactions for that customer. What is needed is a function which takes such a data item and returns the sum of the numbers in the list. Other types of records, such as machine status reports, also contain numbers interspersed with other data. So your function will have lots of uses. Call it data-sum.

Oh, I almost forgot: Some of these lists have some nonnumber entries. Just skip over anything on which number? returns false. Example:

> (define record-1 '(major-customer 20.5 403 99 "late-order" 55.5)) 
> (define record-2 '((milling-machine 5 hourly) 2 2 2 4 2 2 - 1 3 6 - 3 2 2))
> (define record-3 '((milling-machine 8 hourly) 2 2 3 3 2 - 1 4 3 2 3 2 2 -))
> (data-sum '(name))
    0
> (data-sum record-1) 
    578
> (data-sum record-2) 
    31
> (data-sum record-3) 
    29