Question: Question: 1) You need to write an averageThree function to return the average of three integers. averageThree :: Integer -> Integer -> Integer -> Float

Question: 1) You need to write an "averageThree" function to return the average of three integers. averageThree :: Integer -> Integer -> Integer -> Float

2) You need to write a "howManyAboveAverage" function which returns how many of three integer inputs are above its average value. (utilize the averageThree function.) howManyAboveAverage :: Integer -> Integer -> Integer -> Integer

3) You need to write a "howManyWithinThreshold" function that returns how many of the first three argumentsare within the threshold (the fourth argument) of the average of the first three arguments. (utilize the averageThree function and the logic in the howManyAboveAverage function.) howManyWithinThreshold :: Integer -> Integer -> Integer -> Float -> Integer

I personally have completed (1), which is: averageThree :: Integer -> Integer -> Integer -> Float averageThree a b c = (fromIntegral (a + b + c)) / 3

All i need is help with 2 and 3 where i am stuck!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!