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

CPSC 320: Programming Languages (Fall 2021)

Homework

Aside from the language presentations, assignments in CPSC 320: Progrramming Languaages are generally small and first mentioned in lectures. Assignments are to be submitted by e-mail to David.Casperson@unbc.ca.

Homework questions are usually assigned prior to being given a due date. Questions that have been assigned but not yet give a due date can be found on this page.
Questions that have been given a due date can be found here.

Pending homework questions

  1. Look up Noam Chomsky in Wikipedia or elsewhere, and write a brief paragraph explaining who he is, and why he is relevant to Computer Science.

    Now assigned a due-date

  2. What classes does Java have to support regular expressions?

    Now assigned a due-date

  3. What English words match the java regular expression [m-o]{2,4}?

    (Take this to mean where the regular expression matches the entire word.)

    Now assigned a due-date

  4. Determine what lanaguage the finite state machine given in the 2021-09-15 lecture matches.
  5. Write a java regular expression that matches some inifinite set of java regular expressions.
  6. Given an array of numbers a[0], a[1], …, a[n-1], the maxSubseqenceSum algorithm finds the maximum value of
    an equation
    The algorithm is
      public static double maxSubseqenceSum(double [] data)
        {
        final int n = data.length ;
        double maxSum = 0.0 ; double thisSum = 0.0 ;
        for (int i=0; i<n; ++i)
            {
            thisSum = Math.max(thisSum+data[i],0.0) ;
            maxSum  = Math.max(thisSum,maxSum) ;
            }
        return maxSum ;
        }

    • How on earth does this work?
    • More concretely, what is the loop invariant?
  7. How many namespaces are there in Java? Can I have a class, a package, and a label that are all the same, and all mutually visible?

Home page Semesters Site Map
go back Fall 2021 go forward
2024-12 other links

Java
CPSC 200 [Other years]
CPSC 320 [Other years]
Homework
David’s Schedule

UNBC Undergraduate Calendar

fall-2024