Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems For Advanced Applications 18th International Conference Dasfaa 2013 Wuhan China April 22 25 2013 Proceedings Part 2 Lncs 7826

Authors: Weiyi Meng ,Ling Feng ,Stephane Bressan ,Werner Winiwarter ,Wei Song

2013th Edition

3642374492, 978-3642374494

More Books

Students also viewed these Databases questions

Question

Is it clear what happens if an employee violates the policy?

Answered: 1 week ago