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

CPSC 370: Functional and Logic Programming ( )

Pending homework questions

All questions are now due.

  1. A Collatz sequence starts with an arbitrary positive integer n. The next number in the sequence is
    • 3n+1 if n is odd, and
    • n/2 if n is even.
    A sequence ends when n reaches 1.
    1. Write a Racket program that repeatedly asks the user for a starting number and then displays the resulting Collatz sequence.
    2. Add a way for the user to terminate the program.
    3. Add test functions by using (require rackunit) .
    4. <
    5. Write a similar program in Racket.
Home page Semesters Site Map
go back Fall 2016 go forward
2018-06 other links

CPSC 320 [Other years]
CPSC 370 [Other years]
David’s Schedule

UNBC Undergraduate Calendar