


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Assignment; Professor: Leavens; Class: Programming Languages I; Subject: Computer Programming; University: University of Central Florida; Term: Spring 2009;
Typology: Assignments
1 / 4
This page cannot be seen from the preview
Don't miss anything!



COP 4020 — Programming Languages I January 7, 2009
See webcourses and the syllabus for due dates. In this homework you will learn some of the basics of Oz and the Mozart system [UseModels], and, more importantly, you will get an overview of programming concepts [Concepts]. For all Oz programing exercises, you must run your code using the Mozart/Oz system. See the course’s “Running Oz” page for instructions about installation and troubleshooting of the Mozart/Oz system on your own computer. For programming problems for which we provide tests, you can find them all in a zip file, which you can download from the course resources web page or from Webcourses. If the tests don’t pass, please try to say why they don’t pass, as this enhances communication and makes commenting on the code easier and more specific to your problem. Our tests use the functions in the course library’s TestingNoStop.oz. The Test procedure in this file can be passed an actual value, a connective (which is used only in printing), and an expected value, as in the following statement.
{Test {CombA 4 3} ’==’ 24 div (6*1)}
The Assert procedure in this file can be passed a boolean, as in the following statement
{Assert {Comb J I} == {CombB J I}}
Calls to Assert produce no output unless they are passed the argument false. Note that you would not use Browse or Show around a call to Test or Assert. If you’re not sure how to use our testing code, ask us for help. Turn in (on Webcourses) your code and output of your testing for all exercises that require code. Please upload code as text files with the name given in the problem or testing file and with the suffix .oz. Please use the name of the main function as the name of the file. Please upload test output and English answers as plain text files with suffix .txt or as PDF files with suffix .pdf. (In any case, don’t put spaces or tabs in your file names!) Your code should compile with Oz, if it doesn’t you probably should keep working on it. If you don’t have time, at least tell us that you didn’t get it to compile. You should use helping functions whenever you find that useful. Unless we specifically say how you are to solve a problem, feel free to use any functions from the Oz library (base environment), especially functions like Map and FoldR. Don’t hesitate to contact the staff if you are stuck at some point. For background, you should read Chapter 1 of the textbook [VH04] (except section 1.7). But you may also want to refer to the reference and tutorial material on the Mozart/Oz web site. See also the course resources page.
The problems in this section are intended to get you to read the book, ideally in advance of class meetings.
Read section 1.1 and 1.2 of the textbook [VH04] and answer the following questions.
Read sections 1.3-1.15 of the textbook and answer the following questions.
Read sections 1.3-1.15 of the textbook and answer the following questions.
We expect you’ll do the problems in this section after reading the entire chapter. However, you can probably do some of them after reading only part of the chapter.
The textbook problems are from the Concepts, Techniques and Models of Computer Programming book [VH04, section 1.18].
Consider the code in Figure 1 on the following page. (a) (5 points) What do you see in the Oz Browser when you run the code in Figure 1 on the next page using Oz?
This homework’s total points: 102. Total extra credit points: 30.
[VH04] Peter Van Roy and Seif Haridi. Concepts, Techniques, and Models of Computer Programming. The MIT Press, Cambridge, Mass., 2004.