






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
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
1 / 11
This page cannot be seen from the preview
Don't miss anything!







Department of Computer Science Wellesley College
Tuesday, Sep. 4, 2007 Getting Started 1- 2
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:
Getting Started 1- 9 Big idea number 1: Abstraction
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