Work with your assigned partner to write the following programs in Haskell.
Refer to this great book for examples.
Also, Data.List has lots of functions that might be useful for solving these problems.
Create a Haskell program to solve the classic fizz-buzz problem. The program should print all the numbers from one to one hundred, one per line. The numbers should be replace according to three rules:
1 2 Fizz 4 Buzz Fizz 7 8 Fizz Buzz 11 Fizz 13 14 Fizz Buzz 16 17 Fizz 19 Buzz ...
A sample run is listed below. The highlighted text indicates user input.
Welcome to my Change Program Enter the sales price (xx.xx): $3.46 Enter the amount tendered (xx.xx): $5.00 Your change is: $1.54 You will receive: 1 - Dollar Bill 2 - Quarters 4 - Pennies
Approximate the area under a curve, defined by the function f(x) = x^2. The area should be between zero and a user specified end. Divide up the area with rectangles e.g.:
The program should take two numbers: the endpoint of the area and the number of rectangles to estimate the area with.
For example:
End point: 1.0 Number of rectangles: 10 Approximate area: 0.285
This page was last modified on 2026-08-19 at 20:15:09.
George Fox University · 414 N Meridian St · Newberg, Oregon 97132 · 503-538-8383
Copyright © 2018–2026 George Fox University. All rights reserved.