CSE 130: Principles of Programming Languages
Homework Assignments


  1. Due 13 January:
    1. Briefly compare Java with at least three other languages, such as FORTRAN, COBOL, BASIC, Algol, C, Lisp, ML, Ada, C++, etc; the languages that you choose for comparison should be very different from each other; write one paragraph for each comparison; please try to hit the main points and avoid the trivial points.
    2. Say what is your own favorite programming language, and explain why you like it, without falling into merely subjective considerations; i.e., you should base your argument on real historical, cultural, and pragmatic considerations, such as those described in the Essay on Comparative Programming Linguistics.
    3. Exercise 1.10 of Sethi (p. 22).

  2. Due 20 January:
    1. Give a BNF definition (do not use extended BNF) of a language of balanced parentheses, in which the only two tokens are ( and ). For example, ()() and ((()))()((()())) are in the language, but ((() is not.
    2. Exercise 2.7 of Sethi (p. 49).
    3. Exercise 2.8 of Sethi (p. 49).

  3. Due 27 January:
    1. Exercise 3.2 of Sethi (p. 95).
    2. Exercise 3.10 of Sethi (p. 97).
    3. Write pseudo-code for the computation of leap year in Example 3.1 (page 66) using a case statement based on the remainder of year divided by 400; you may use a nested case statement, but do not use any conditionals.

  4. Due 3 February:
    1. Exercise 4.3 of Sethi (p. 143).
    2. Exercise 4.7 of Sethi (p. 145).
    3. Exercise 4.8 of Sethi (p. 145).
  5. Due 10 February:
    1. Exercise 5.2 of Sethi (p. 198-99).
    2. Exercise 5.8 of Sethi (p. 201).
    3. Exercise 5.9 of Sethi (p. 201).
  6. Due 19 February:
    1. Exercise 6.1 of Sethi (p. 248).
    2. Exercise 6.2 of Sethi (p. 248); hand in source code and output showing that the compiled code executes correctly on some not totally trivial examples. You may use Java instead of C++ if you prefer.
    3. Exercise 6.4 of Sethi (p. 248).
  7. Due 26 February:
    1. Exercise 8.2 of Sethi (p. 336-7).
    2. Exercise 8.3 of Sethi (p. 337).
    3. Exercise 8.12 of Sethi (p. 338).

  8. Due 4 March: Your code should be executable and you should hand in output for two test cases for each part of each question.
    1. Exercise 11.2 of Sethi (p. 470).
    2. Exercise 11.4 of Sethi (p. 471).
    3. Exercise 11.5 of Sethi (p. 471).
    Note: You may use a different Prolog than BinProlog if you prefer.
  9. Due 11 March: You should run your code and hand in the output for two test cases for each part of each question where applicable.
    1. Exercise 9.3 of Sethi (p. 380).
    2. Exercise 9.5 of Sethi ( p. 380).
    3. Exercise 9.8 of Sethi ( p. 381).

Standard ML of New Jersey, version 110.0.6 is available on all CSE unix machines at /net/cs/class/development/elkan/cse230/sml-110/bin/sml, which you can either define as an alias for sml, or else you can add the path for its directory to the PATH variable of your environment. You should actually run your ML code for all of the ML programming problems, and turn in your code along with its output.

Binary for BinProlog 4.00 for Solaris machines (such as the CSE instructional machines beowulf, bintijua, kongo, or the machines in the APE lab) can be found at /net/cs/class/wi99/cse230/prolog/bp, and also as a backup, at /net/cat/disk1/prolog/bp; the latter directory also contains some other files, including some relevant to exercises, so that you don't have to do all the typing yourself. Some basic notes on using BinProlog 4.00 are at binpro.html.

To CSE 130 homepage
Maintained by Joseph Goguen
© 2000 - 2004 Joseph Goguen
Last modified: Sat Mar 13 19:50:58 PST 2004