Unless you are completely confident of your signature-writing skills,
please use “concrete” type classes like Double
or Integer
instead
of class constraints like (Floating a)
or (Integral a)
everywhere
you write code that will actually run.
This is the only part of the test where you should attempt to use class constraints (if you know them).
The whatSig
function takes in an ordered pair, a distance, and
two strings. If the ordered pair is within the distance of (0,0),
then the answer is the first string, otherwise the answer is the
second string. What is an appropriate the signature (only) for
this function?
whatSig (3,4) 10 "Close" "Far" == "Close"
Give an example of an ability that the Fractional
class
constraint provides that is not available with an Integral
class
constraint.
Give an example of an ability that the Floating
class constraint
provides that is not available with Fractional
.
(someSqrt
) Write a signature and the function.
The someSqrt
function that takes in a list of x values and puts out a
list of points:
(midAvg
) Given a list of Double
numbers with 3 or more
elements, the midAvg
function gets rid of the first and the last
element, then finds the average of the remaining list. Write the
complete function, including signature.
oddVowels. A word is an odd vowel word if all of the vowels in the word appear in odd index positions (remember indexing starts at zero).
odO theWord
: Return all of the odd vowels in the word.odA theWord
: Determine if a single word is an odd vowel word.odB theList
: Return a list of all of the odd vowel words in theList.odA "xz" == True
odA "a" == False
odA "raw fud gg" == True
odA "pizzza" == True
odA "cucumber" == False