Question: Please write the answer on Haskell Notation The US currency is the dollar. 1 dollar = 100 cents. In US currency, there are several types
Please write the answer on Haskell Notation
The US currency is the dollar. 1 dollar = 100 cents. In US currency, there are several types of coins, each of which is given a name, namely quarter (1 quarter = 25 cents = 0.25 dollars), dime (1 dime = 10 cents = 0.1 dollars), nickel (1 nickel = 5 cents = 0.05 dollars), and penny (1 penny = 1 cent = 0.01 dollars). Create a function in Haskell that accepts as input a number of quarter, dime, nickel, and penny coins and returns how many dollars and how many cents are worth the total of those coins. Example: 8 quarters, 20 dimes, 30 nickels, and 77 pennies are the same as 6 dollars and 27 cents. Note that the resulting output is avalue pair.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
