# dieing in drscheme

This topic is 3335 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

these are the two questions, and honestly i've stared at them for a while and i still don't know how or where to start. I'm hoping someone here will help me out, greatly appreciated 1. Create a function largest-even that consumes a list of integers. If the list has no even integers, your function should produce false. Otherwise, it should produce the largest even integer in the list. Note: negative integers can be even. 2. Create a function omit-vowels that consumes a string and produces the string formed by removing all vowels (a, e, i, o, u, A, E, I, O, U).

##### Share on other sites
Sounds a little like a school/uni question.

Are you going to be using scheme for this, don't think you will find many schemers here though.

I could help with common lisp but I have no experience of scheme.

They are both dialects of lisp so if you post some code here I'll check back and give you my thoughts, you need to make some attempt first though, as I think it would be against the rules for me to help yet.

##### Share on other sites
A hint for number 2.

(define (isOne? numb) (= numb 1))

(filter isOne? (list 1 2 3 4 5 6 7 1 1))

returns the value (1 1 1)

Actually it is pretty useful for number one as well especially when you know about the even? predicate.

##### Share on other sites
stonemetals approach could also work for question 1.

1. Create a function to test if an integer is even and positive.
2. Filter the list.
3. If the resulting list is empty, return false. Otherwise find the highest integer in it.

##### Share on other sites
Recursion, you know?

Quote:
 Original post by takeachance1. Create a function largest-even that consumes a list of integers. If the list has no even integers,your function should produce false. Otherwise, it should produce the largest even integer inthe list. Note: negative integers can be even.

This is the largest even number in the cdr of the list, unless the car of the list is both even and greater than any even number in the cdr of the list. And #f for an empty list.

Quote:
 2. Create a function omit-vowels that consumes a string and produces the string formed byremoving all vowels (a, e, i, o, u, A, E, I, O, U).

This is the first character of the string (unless it's a vowel, in which case we put nothing) followed by the result of omitting vowels from the rest of the string.

##### Share on other sites
Those questions are from University of Waterloo cs115 assignment 4. If you can't understand those easy questions then you'll fail the midterm next monday. :p

##### Share on other sites
Quote:
 Original post by BoundaryValueThose questions are from University of Waterloo cs115 assignment 4. If you can't understand those easy questions then you'll fail the midterm next monday. :p

Yeah, we already figured out it was a homework question - thus the nature of the responses. Nice detective work, but ultimately not useful.

1. 1
2. 2
Rutin
18
3. 3
4. 4
5. 5

• 13
• 26
• 10
• 11
• 9
• ### Forum Statistics

• Total Topics
633735
• Total Posts
3013597
×