This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: CSE 91: Programming Languages Homework September 28, 2009 To do this homework, you will need to use one of the following web browsers: Firefox Safari Google Chrome Load the following drawing canvas web page in one of the browsers listed above: http://www.cs.ucsd.edu/ ~ prondon/canvas.html Tip: This homework will be much easier if you read through it before at- tempting the exercises. 1 Building Cities With Abstractions Programming languages abstract the details of what the computer does, letting you focus on the task at hand, whether its writing, drawing, or making music. To further help you concentrate on your goal, a good programming language will allow you to make your own abstractions. In this homework, well explore the power of abstraction through an example which draws a city composed of several buildings, each of which is composed of several floors. With abstraction, you can define a term once and use it many times and in many different ways. This saves you effort in two ways. First, by defining and using a term rather than writing its definition everywhere, you avoid mistakes and unnecessary repetition. Second, by defining and using a term rather than just writing its definition everywhere, its easy to make a change that applies to all uses of the term just by changing its definition, which would be much harder if you had written it out each time....
View Full Document
This note was uploaded on 08/31/2011 for the course CSE 91 taught by Professor Staff during the Fall '08 term at UCSD.
- Fall '08