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
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
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.

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

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

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

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
Subscribers Only

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

Unlock Document
Subscribers Only

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.

Notes
Practice
Earn
Me

OR

Don't have an account?

Join OneClass

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

Join to view

OR

By registering, I agree to the Terms and Privacy Policies
Just a few more details

So we can recommend you notes for your school.