COMP 202 Foundations of Programming

Instructor: Juan Camilo Gamboa Higuera

Use the arrow keys to navigate. Press 'm' to see all the slides.

Who am I

Born and raised in Bucaramanga, Colombia

Spent a bunch of years figuring out what I wanted to do in Bogotá, Colombia

Hoped to make a living writing code

Decided I wanted to build and program robots and moved to Montreal

Got a MSc in CS

Hoping to make a living writing code

What I'm doing now

getting a phd in cs

Getting a PhD in CS

(You should find this funny by the end of this course, maybe)

Preliminary remarks

Why are you taking this class?


This is a required course for your program

You're in CS and have no idea about programming

You're considering joining CS and have no idea about programming

You're have no idea about programming and want to learn the basics


Preliminary remarks

Why should you care about this course?


Because you want to do neat things with computers

Because you think you will learn an useuful skill

Because it costs you (or your parents) money


Personal opinion: Programming a computer will become a necessary basic skill.

What skills we aim to develop in this class?

computer problems

Prerequisites?

A Computer Scientist's Tool #1

A Computer Scientist's Tool #2

Course Administration

Some rules/suggestions/tips

  • Do the Assignments. Start Early!
  • Ask questions
    • There are 3 course instructors
    • There are 10 Teaching assistants
    • 250 students in this section
  • Share ideas, work in groups, collaborate
  • Do not share code:
    • Let others discover new/different/clever solutions

Moving on

This week

  1. Preliminary remarks

    Motivations

    Expectations

    Course Administration

  2. Basic concepts

    Algorithms

    Binary

    ASCII

  3. Basic tools for this course

    Scratch

    Java

    Eclipse

What is an algorithm?

A sequence of instructions that transforms some initial conditions into some desired final conditions

e.g.

  • Arithmetic operations
  • Sorting your groceries in alphabetical order
  • Counting the number of people in a room

What is an algorithm?

A sequence of instructions that transforms data

Two numbers into the result of an arithmetic operation

A yes/no question into an answer: yes or no (Decision)

A question about a set of numbers into a number that answers that question (Search)

How is information represented on a computer?

10

There are 10 types of people in the world:

How is information represented on a computer?

Bit: 0 or 1

Counting with bits:

0 decimal = 0 binary

1 decimal = 1 binary

2 decimal = 10 binary

3 decimal = 11 binary

10 decimal = 1010 binary

What is 11101010?

Decimal: base 10, Binary: base 2

How is information represented on a computer?

How about text?

Resources

/