{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

plhomework - CSE 91 Programming Languages Homework To do...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
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 it’s 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, we’ll 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, it’s 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.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}