Introduction to Computer Science
CMPT 100, Spring 2019
Google classroom: 9lgur7
This course provides an introduction to fundamental concepts of Computer Science, both as a prelude to further study in the discipline and to serve broader educational goals. The course uses Python, a high-level, portable, and well-constructed computer programming language to demonstrate these concepts. The focus is on data types and control structures, functions, recursion, and iteration - all this in context of real-life tasks.
By the end of the course students are expected to be able to read and understand the concepts expressed in Python code and to create their own programs.
Table of contents |
---|
1. Course Info
1.1. Contacts |
|
---|---|
Instructor: | Marina Barsky |
Lecture hours: | TR, 10:35 - 12:00, FSH 201 |
Office hours: | Thursday, 3:30 - 5:30, FSH 130 |
e-mail: | [email protected] |
1.2. Textbook
"How to Think Like a Computer Scientist" by Peter Wentworth, Jeffrey Elkner, Allen B. Downey, and Chris Meyers. On-line resource.
1.3. Deliverables |
|||
---|---|---|---|
Weekly programming quizzes | 15% | (in-class) | |
Homework assignments | 25% | (at home) | |
Midterm exam | 10% | (in-class) | |
Final project*: | 25% | Due: last week of classes | |
Final exam*: | 25% | Scheduled by the college |
*Score of at least 50% is required in order to pass the course.
2. Lectures
- CS primer
What is computer science and why study it? Slides 01.01.
A (very) brief history of computing: Slides 01.02. Turing machine demo.
Talking to machines. Slides 01.03. - Python syntax: writing dialogues.
Self-study:
Variables. Expressions. Input and output. Try and except. Slides 02.01.
Boolean logic. Slides 02.02.
Conditional execution: if statements. Slides 02.03.
Readings: Chapter 2, Chapter 5 (5.1-5.8,5.10-5.11).
Check yourself: Quiz 1.
Syntax workout: preparation for Homework 1.
Summary.
Code examples: celsius.py. fahren.py. if_elif.py. grade.py. pay.py. Full guessing game: code.
Sample dialog: Eliza, computer therapist.
Homework 1: Writing interactive stories. Demo. Due: February 10. - Sequences. Strings and lists.
Concatenating, repeating, indexing, slicing. Slides 02.05.
Readings: Chapter 8: 8.1 - 8.4, 8.6, Chapter 11: 11.1 - 11.7.
Strings and lists workout. - Functions. Built-in functions. Defining new functions. Docstrings.
Parameters and return values. Nested functions. Slides 03.01.
Function practice. Patterns. Slides 03.02.
Nested functions. Slides 03.03.
Check yourself: Quiz 2.
Readings: try to read about functions in a different book: Chapter 2.5.
Homework 2: Love letter generator. Demo. Starter code. Due: February 22. - Imperative programming. WHILE loops. Slides 04.01.
FOR loops. Slides 04.02.
Loop idioms and patterns. Slides 04.03.
Readings: Chapter 8.1 - 8.3.
Check yourself: Quiz 3.
Using loops with Turtle graphics. Slides 04.04.
Readings: Chapter 4.
Homework 3: Turtle art. Demo. Due: March 18.
More on lists and list comprehensions. Slides 04.05.
Readings: Chapter 10.
Check yourself: Quiz 4. - Handling data.
Opening, reading and writing text from/to files. Slides 05.01.
Dictionaries. Slides 05.02.
Check yourself: Quiz 5.
Readings: Chapter 11 and Chapter 12.
Review. Slides 05.03.
Program structure. Running scripts from command-line. Slides 05.04.
Homework 4: Files and dictionaries. Due: April 19. - Recursion. Recursive functions.
Slides 06.01.
Check yourself: Quiz 6.
Recursive graphics with turtle. Fractals in nature and beyond. Slides 06.02.
Homework 5: Recursive rendering.
Readings: Different book: Chapter 2. - Object-Oriented Programming. Objects in Python. Defining new object type (class).
Slides 07.01.
Special methods. Slides 07.02.
Reusing objects: inheritance and composition. Slides 07.03.
Check yourself: Quiz 7.
Programs as interactive objects. Simple interactive game. Slides 07.04.
Readings: Chapter 16.
[Optional]: GUI: Chapter 14, all_widgets.
*Unless specified otherwise, readings refer to the chapters in the main textbook.
3. Homework assignments
To submit: join the Google classroom (code 9lgur7)
- Homework 1: Writing interactive stories. Demo. Due: February 10.
- Homework 2: Love letter generator. Demo. Starter code. Due: February 22.
- Homework 3: Turtle art. Demo. Due: March 18.
- Homework 4: Friend finder. Due: April 19.
- Homework 5: Recursive rendering. Due: April 30.
4. Final Project
Wide open: what do you want to create?