
CMSI 182
IN T R O D U C T I O N T O CO M P U T E R SC I E N C E
Fall 2006
Assignment 0914
Alright, time to get your feet wet and your hands dirty. This combination of written and programmed exer-
cises is meant to cement your understanding of how computers “see” and “work with” the information that
we use everyday.
Not for Submission
Read Chapters 1 and 2 in the Brookshear book.
For Submission
Submit all work on hardcopy at the beginning of our September 14 class.
1. Do the following exercises from Chapter 1 of the Brookshear book:
a. Questions 2 and 3 on page 30
b. Chapter review problems 1.1, 1.2, 1.5, 1.7, 1.9, 1.12, 1.19, 1.20, 1.24, 1.25
2. Here it is — your first program! Type this JavaScript program into the JavaScript scratch page on the
course Web site and run it by clicking on the page’s Run button. Remember that absolute accuracy is
required — this code must be entered exactly as shown (at least until you’ve gained a little more experi-
ence and knowledge on the subject):
var a = "Hello";
var b = "World";
alert(a + b);
var i = 1;
var j = 1;
alert(i + j);
var c = "1";
var d = "1";
alert(c + d);
var x = 1.5;
var y = 3.25;
alert(x + y);
alert(i + j + a + b + c + d + x + y);
What happens when you run this program? For each alert command (there are five of them), explain
what you think the computer is doing with the expression that is being “alerted.”
3. Do the following exercises from Chapter 2 of the Brookshear book:
a. Question 3 on page 82
b. Questions 1 and 2 on page 88