CS 101
Midterm Review
Logistics
Midterm
Tuesday, October 30
during class
in STLC 115
Covers first five weeks of lecture
Closed note, closed book, reference sheet will be provided
Plan for Today
High-Level Course Review
Go Over Reference Sheet
Examples
The Story So Far...
Computer Hardware
Data and Storage
Introduction to Code
Artificial Intelligence
Theory
The Story So Far...
Computer Hardware
Data and Storage
Introduction to Code
Artificial Intelligence
Theory
Computer Hardware
Strengths/Weaknesses of Computers
Introduction to Code (and bugs!)
Parts of a Computer
Machine Code
Operating System
Programming Languages
Open Source
Introduction to Hardware:
Parts of a Computer
Computer Abstractions
The Operating System
Starts running when the computer "boots up"
Manager/supervisor
Starting/stopping programs
Manages RAM, persistent storage, and other shared resources between programs
Can run multiple programs at once ("sandboxing")
Allows a computer to change over time (updates)
Other responsibilities:
File system
Manages windows
Some basic programs
The Story So Far...
Computer Hardware
Data and Storage
Introduction to Code
Artificial Intelligence
Theory
Data and Storage
Representing and Storing Data
Compression
Images
Pixels
Pixel:
one "cell" of an image
Each pixel is one color
Corresponds to one cell in CCD
Pixels are stored in a grid:
The Story So Far...
Computer Hardware
Data and Storage
Introduction to Code
Artificial Intelligence
Introduction to Code
For Loops
If Statements
Combining Conditionals
Image Filters
Spreadsheets and Data
The Story So Far...
Computer Hardware
Data and Storage
Introduction to Code
Artificial Intelligence
Theory
Artificial Intelligence
Machine Learning
Natural Language Processing
Artificial Vision
Robotics
AI: A Brief Overview
Input: data
Output:
model
used to make
predictions
Predictions
make it seem as if the computer is thinking
Makes guesses about new data
The Story So Far...
Computer Hardware
Data and Storage
Introduction to Code
Artificial Intelligence
Reference Sheet
Reference Sheet
Introduction to Code: Bugs
Two types:
syntax
and
logic
errors
myLuckyNumber = 7 guess = prompt("Guess my lucky number"; if (guess == myLuckyNumber) { print("That isn't it!"); } else { print("You guessed it."); }
Adding a Border
image = new SimpleImage("yosemite.jpg"); image.setZoom(0.5); borderSize = 10 for (pixel : image) { //Add the border here } print(image);
Tracing Through Code
coke = 2; pepsi = 9; z = 1; //Image has 2 pixels total img = new SimpleImage("2pixels.jpg"); for (pixel : img) { coke = coke + z pepsi = z pepsi = pepsi + z } if (coke > pepsi) { print("Coke is greater than pepsi."); } else { print("Pepsi is greater than coke."); }