Computer Science Canada Test Your Skills: Smalltalk Edition |
Author: | wtd [ Mon May 21, 2007 11:19 am ] | ||
Post subject: | Test Your Skills: Smalltalk Edition | ||
Write the shortest possible (non-obfuscated) code which takes an array of integers "foo" and finds the first element which is a multiple of both 7 and 2. It should store this element in a variable "bar". If no such element is found, zero should be stored in "bar" and the following message printed as a side-effect. Quote: Nothing found, assuming default value.
A Java implementation is provided.
|