Last modified: $
This is a course web page of
David Casperson
Associate Professor
Computer Science
University of Northern British Columbia

CPSC 370: Functional and Logic Programming ( )

Homework Questions now due

Homework that is still pending can be found at http://casper.unbc.ca/Semesters/2019-05F/370-homework-pending.php, or by clicking on CPSC 370 Homework Pending to the right.


I would like to post my solutions to these problems. Please complete by Friday 06, or e-mail with estimates of when you reasonably think that you will complete these problems.

  1. Write a tail-recursive function that sums the values of an Tree Int. Code this directly (no fold equivalents).
  2. Write the equivalent of a foldr function for Tree's.
  3. Create an instance of Foldable for the Tree class. Rewrite sum using the Sum Monoid.
  4. Give examples of syntactic sugar in Java.

Equations for gcd

Equations for sine

  1. Write a Haskell function to compute the sine of a number using the supplied equations. Use guards.
    • Attempt to measure the accuracy of this function compared to the builting sin function.
  2. Write a Haskell program to compute the date of Easter. Use the algorithm from Lab 4 from my web-pages for CPSC 100 in Winter 2008.
Home page Semesters Site Map
go back Fall 2019 go forward
2022-12 other links

Java
CPSC 200 [Other years]
CPSC 320 [Other years]
CPSC 370 [Other years]
References
Homework
Dates
Policies
Resources
 
Labour News
 
David’s Schedule

Semester Dates…