Study Guides (275,966)
CA (151,071)
McGill (5,746)
COMP (127)
COMP 202 (31)
Study Guide

COMP 202- Final Exam Guide - Comprehensive Notes for the exam ( 122 pages long!)
Premium

122 Pages
16 Views
Fall 2016

Department
Computer Science (Sci)
Course Code
COMP 202
Professor
Daniel Pomerantz
Study Guide
Final

This preview shows pages 1-3. Sign up to view the full 122 pages of the document.
McGill
COMP 202
Final EXAM
STUDY GUIDE
COMP 202 Lecture 1 September 2, 2016
Lecture 1: Course Intro
Required Software
Download the JDK (Java Development Kit) from:
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
And download the development environment dr java: http://www.drjava.org/
How Computers Store Images
A computer screen is a bunch of really small lights, called pixels.
Each pixel can be red, green, or blue. Any colour can be displayed, using different lights at
different intensities. Note that the rules for combining colours of light are different from colours
of paint.
Images as Numbers
Generally, we can store each pixel in an image as a `triple' of numbers, (R,G,B). The number in
the first position tells us how much red `intensity' that pixel has; the second corresponds to
green and the third to blue. The largest value of these numbers is usually 255 and the smallest
is 0. So a 200 by 250 picture can be stored using 250x200x3 = 150000 numbers.
**Computers will use as few numbers as possible to store information.
Computer Programming
is providing a computer with a set of instructions in order to accomplish a goal or solve a
problem. These instructions must be very specific, and they must be written in a language that
computers understand
Computer Languages
The computer takes everything you write literally. here is no room for ambiguity. The
programmer must know precisely how the computer will interpret his or her statement. The
computer will not ask you for additional feedback or clarification.
find more resources at oneclass.com
find more resources at oneclass.com
COMP 202 Lecture 2 September 7, 2016
Lecture 2: Binary & Program Structure
How does a computer work?
Similar to light switches in that it can only be on or off, no in between.
Computer uses ones and zeros (binary) to indicate this, where:
Off = 0
On = 1
Base 10 Decimal
5 = 5 × 100
25 = 2 × 101 + 5 × 100
425 = 4 × 102 + 2 × 101 + 5 × 100
3425 = 3 × 103 + 4 × 102 + 2 × 101 + 5 × 100
Base 2 Binary
0 = 0 × 20
10 = 1 × 21 + 0 × 20
110 = 1 × 22 + 1 × 21 + 0 × 20
1110 = 1 × 23 + 1 × 22 + 1 × 21 + 0 × 20
01110 = 0 × 24 + 1 × 23 + 1 × 22 + 1 × 21 + 0 × 20
101110 = 1 × 25 + 0 × 24 + 1 × 23 + 1 × 22 + 1 × 21 + 0 × 20
Counting in Binary
010 → 0002
110 → 0012
210 → 0102
310 → 0112
410 → 1002
510 → 1012
610 1102
710 1112
Converting Binary to Decimal
Ex: What is 1011102 in decimal notation (base 10)?
1011102 = 1 × 25 + 0 × 24+ 1 × 23 + 1 × 22 + 1 × 21 + 0 × 20
1011102 = 25 + 0 + 23 + 22 + 21 + 0
1011102 = 32 + 0 + 8 + 4 + 2 + 0
1011102 = 4610
101110 ends in 0, so the answer should be an even number, which it is (46)
Note:
Even numbers (0,2,4…) end in 0
Odd numbers (1,3,5…) end in 1
find more resources at oneclass.com
find more resources at oneclass.com

Loved by over 2.2 million students

Over 90% improved by at least one letter grade.

Leah — University of Toronto

OneClass has been such a huge help in my studies at UofT especially since I am a transfer student. OneClass is the study buddy I never had before and definitely gives me the extra push to get from a B to an A!

Leah — University of Toronto
Saarim — University of Michigan

Balancing social life With academics can be difficult, that is why I'm so glad that OneClass is out there where I can find the top notes for all of my classes. Now I can be the all-star student I want to be.

Saarim — University of Michigan
Jenna — University of Wisconsin

As a college student living on a college budget, I love how easy it is to earn gift cards just by submitting my notes.

Jenna — University of Wisconsin
Anne — University of California

OneClass has allowed me to catch up with my most difficult course! #lifesaver

Anne — University of California
Description
[COMP 202] Comprehensive fall guide including any lecture notes, textbook notes and exam guides.find more resources at oneclass.com COMP 202 Lecture 1 September 2, 2016 Lecture 1: Course Intro Required Software Download the JDK (Java Development Kit) from: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html And download the development environment dr java: http://www.drjava.org/ How Computers Store Images A computer screen is a bunch of really small lights, called pixels. Each pixel can be red, green, or blue. Any colour can be displayed, using different lights at different intensities. Note that the rules for combining colours of light are different from colours of paint. Images as Numbers Generally, we can store each pixel in an image as a `triple' of numbers, (R,G,B). The number in the first position tells us how much red `intensity' that pixel has; the second corresponds to green and the third to blue. The largest value of these numbers is usually 255 and the smallest is 0. So a 200 by 250 picture can be stored using 250x200x3 = 150000 numbers. **Computers will use as few numbers as possible to store information. Computer Programming is providing a computer with a set of instructions in order to accomplish a goal or solve a problem. These instructions must be very specific, and they must be written in a language that computers understand Computer Languages The computer takes everything you write literally. here is no room for ambiguity. The programmer must know precisely how the computer will interpret his or her statement. The computer will not ask you for additional feedback or clarification. find more resources at oneclass.com
More Less
Unlock Document
Subscribers Only

Only pages 1-3 are available for preview. Some parts have been intentionally blurred.

Unlock Document
Subscribers Only
You're Reading a Preview

Unlock to view full version

Unlock Document
Subscribers Only

You've reached the limit of 4 previews this month

Create an account for unlimited previews.

Already have an account?

Log In


OR

Don't have an account?

Join OneClass

Access over 10 million pages of study
documents for 1.3 million courses.

Sign up

Join to view


OR

By registering, I agree to the Terms and Privacy Policies
Already have an account?
Just a few more details

So we can recommend you notes for your school.

Reset Password

Please enter below the email address you registered with and we will send you a link to reset your password.

Add your courses

Get notes from the top students in your class.


Submit