Question: using Haskell : 1. Write a function isZeroOrGreater that returns whether a given int is greater than or equal to zero. isZeroOrGreater :: Int ->

using Haskell : 1. Write a function isZeroOrGreater that returns whether a given int is greater than or equal to zero. isZeroOrGreater :: Int -> Bool

2. Write a function sphereVolume that computes the volume of a sphere given its radius. Use 3.14 for . sphereVolume :: Float -> Float

3. Write a function ceilingDecimal that calculates the ceiling of an oat, but returns it as a oat rather than an integer. ceilingDecimal 15.1 should return 16.0. ceilingDecimal :: Float -> Float 4. Write a function averageThree to return the average of three integers. averageThree :: Integer -> Integer -> Integer -> Float

5. Write a function fourDifferent that returns True if no two of the four arguments are equal, and False otherwise. fourDifferent :: Integer -> Integer -> Integer -> Integer -> Bool

6. Write a function sum' that that uses recursion to compute the sum of all numbers from 1 to n, where n is greater than or equal to 1. sum' :: Integer -> Integer

7. Write a function abssum that uses recursion to compute the sum of the absolute values from m to n, where m is less than or equal to n. abssum :: Integer -> Integer -> Integer

8. Write a function exponent' that recursively computes the result of raising some base number, b, to some exponent, e. (e.g. 2^8 = 256). You may not use the ^ or ** operators -- you must use recursion. This function will only be called on an exponent value that is a whole number (an integer that is 0 or greater). exponent' :: Integer -> Integer -> Integer

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!