Lists in Haskell


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.

Fizzbuzz


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
...



Change Maker


Write a program that accepts a sales amount (in dollars) and an amount tendered (in dollars) and then displays to the screen the change (in dollars) along with only the correct denominations of money returned.

Your output needs to be grammatically correct (e.g., "2 quarters", "1 quarter").

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


Area under the curve


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.

Copyright © 2018–2026 George Fox University. All rights reserved.