Getting Started in CS111: An Introduction to Computer Programming at Wellesley College, Study notes of Computer Science

An overview of the cs111 computer programming course offered at wellesley college. It covers topics such as course fundamentals, getting started, lab registration, course materials, help resources, and the importance of computer science. It also introduces the four big ideas of the course: abstraction, modularity, divide, conquer and glue, and models.

Typology: Study notes

Pre 2010

Uploaded on 08/18/2009

koofers-user-z8n
koofers-user-z8n 🇺🇸

9 documents

1 / 11

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1
CS111 Computer Programming
Department of Computer Science
Wellesley College
Introduction to CS111
Tuesday, Sep. 4, 2007
Getting Started 1-2
Am I in the right class?
oCS111 introduces the
fundamentals of programming
and problem solving
techniques using Java.
oMore advanced concepts are
taught in CS230, Data
Structures.
oCS110, Computer Science and
the Internet, teaches web
design.
oCS112, Computation for the
Sciences, teaches
programming skills using
MATLAB
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Getting Started in CS111: An Introduction to Computer Programming at Wellesley College and more Study notes Computer Science in PDF only on Docsity!

CS111 Computer Programming

Department of Computer Science Wellesley College

Introduction to CS

Tuesday, Sep. 4, 2007 Getting Started 1- 2

Am I in the right class?

o CS111 introduces the fundamentals of programming and problem solving techniques using Java. o More advanced concepts are taught in CS230, Data Structures. o CS110, Computer Science and the Internet, teaches web design. o CS112, Computation for the Sciences, teaches programming skills using MATLAB

Getting Started 1- 3 Please register for lab section* o Labs provide hands on experience with the ideas presented in lecture. o Labs meet Wednesdays at 8:30 -- 10:20, 10:30 -- 12:20, and 2:15 -- 4:05. o If you cannot get into the section you want, register for another and use Q&A to arrange a swap. This does not satisfy the Wellesley laboratory requirement. Getting Started 1- 4 You needn’t go to the bookstore o All course materials may be found at o The CS file server, cs.wellesley.edu, is used to download and upload programming assignments. *Assignment 0, due by 4pm today, gets you an account. Lab 1 shows you how to use it. Assignment 1, due on Tuesday, September 11 http://cs.wellesley.edu/~cs

Getting Started 1- 7 What is Computer Science? o It’s not really about computers. o It’s not really a science. o It’s about imperative (“how to”) knowledge as opposed to declarative (“what is”) knowledge. o Imperative knowledge is expressed via algorithms = computational recipes. o “A computer language … is a novel formal medium for expressing ideas about methodology, not just a way to get a computer to perform operations. Programs are written for people to read, and only incidentally for machines to execute” -- Harold Abelson and Gerald J. Sussman Getting Started 1- 8 Four big ideas o Four important concepts are at the core of this course:

  1. Abstraction;
  2. Modularity;
  3. Divide, Conquer and Glue;
  4. Models o These interrelated ideas are important in almost every discipline, but they’re at the core of CS. o We will illustrate these ideas in several ways. o Our goal is to help you think about problem solving in new ways.

Getting Started 1- 9 Big idea number 1: Abstraction

Class

Black Box

Implementer / Designer User / Client Contract *Visit http://cs.wellesley.edu/~cs111/contracts for some useful Java contracts, which are known as Application Programming Interfaces (APIs). Getting Started 1- 10 Big idea number 2: Modularity o Large systems are built from components called modules. o The interfaces between modules are designed so they can be put together in a mix-and-match way. o In Java, goal is to design classes for maximum reusability.

Getting Started 1- 13 A world of problems: BuggleWorld becky the Buggle BuggleWorld Getting Started 1- 14 BuggleWorld

Getting Started 1- 15 Bagels for Breakfast Getting Started 1- 16 Becky buys a bagel public class BreakfastWorld extends BuggleWorld { public void run () { Buggle becky = new Buggle(); // becky goes outside becky.forward( 2 ); becky.left(); becky.forward(); becky.right(); becky.forward(); becky.right(); becky.forward(); becky.left(); // walks to the bagel becky.forward( 2 ); // and chows down becky.pickUpBagel(); } }

Getting Started 1- 19 Compilers 01110100101 01001111010 00100011110 11010001011 00010001100 00100111100 00000111111 01111110011 public void run () { Buggle ben = new Buggle(); ben.left(); ben.forward(4); ben.backward(2); ben.right(); ben.forward(2); ben.left(); ben.forward(2); ben.backward(4); ben.right(); ben.forward(); } (^) Source code Compiler Object code Results^ Object code interpreter Getting Started 1- 20 Java does both jtklew0er# ^720[l8scWq kls;wkjjh3? nnmsllw7y0* y%#&jk23=} (kd1*8,<vV p+}ke56&8) kls;wghjh3? public void run () { Buggle ben = new Buggle(); ben.left(); ben.forward(4); ben.backward(2); ben.right(); ben.forward(2); ben.left(); ben.forward(2); ben.backward(4); ben.right(); ben.forward(); } (^) Source code (.java) Compiler Java byte codes (.class) Interpreter Results (JVM = Java Virtual Machine)

Getting Started 1- 21 helps you both edit and compile Getting Started 1- 22 Beyond Buggles

These worlds include:

o PictureWorld

o TurtleWorld

o Java Graphics

o AnimationWorld

We will use several “microworlds” other than

BuggleWorld for problem-solving activies. You can see

examples of these at:

http://cs.wellesley.edu/~cs111/museum.html