Intensive Introduction to Computer Science. Course Overview Programming in Scratch

Similar documents
CSC116: Introduction to Computing - Java

Announcements. 1. Forms to return today after class:

CSC116: Introduction to Computing - Java

CS 106B, Lecture 1 Introduction to C++

CSC 172 Data Structures and Algorithms. Fall 2017 TuTh 3:25 pm 4:40 pm Aug 30- Dec 22 Hoyt Auditorium

Introduction: Abstract Data Types and Java Review

Welcome to CompSci 201

Introduction: Abstract Data Types and Java Review

CSC116: Introduction to Computing - Java

Unit 10: Data Structures CS 101, Fall 2018

CSci 4211: Introduction to Computer Networks. Time: Monday and Wednesday 2:30 to 3:45 pm Location: Smith Hall 231 Fall 2018, 3 Credits

CS 241 Data Organization. August 21, 2018

CS/ENGRD 2110 Object-Oriented Programming and Data Structures Spring 2012 Thorsten Joachims

San José State University Computer Science Department CS49J, Section 3, Programming in Java, Fall 2015

Introduction to Data Structures

Outline. CIS 110: Introduction to Computer Programming. What is Computer Science? What is computer programming? What is computer science?

CS 11 java track: lecture 1

Anjuli Kannan. Google Earth Driving Simulators (3:00-7:00)

CSci 4211: Data Communications and Computer Networks. Time: Monday and Wednesday 1 pm to 2:15 pm Location: Vincent Hall 16 Spring 2016, 3 Credits

Chapter 1: Building Blocks of Programming

CSCI 201L Syllabus Principles of Software Development Spring 2018

Introduction to Programming System Design CSCI 455x (4 Units)

CS 241 Data Organization using C

AN INTRODUCTION TO SCRATCH (2) PROGRAMMING

Object-Oriented Programming for Managers

EECS 282 Information Systems Design and Programming. Atul Prakash Professor, Computer Science and Engineering University of Michigan

Crossley Fields - Computing Vocabulary

AP Computer Science A Summer Assignment 2017

Lecture 1: Welcome! CSE 373: Data Structures and Algorithms CSE WI - KASEY CHAMPION 1

COMP 401 COURSE OVERVIEW

ECE 122 Engineering Problem Solving with Java

Computer Science E-119 Fall Problem Set 1. Due before lecture on Wednesday, September 26

KOMAR UNIVERSITY OF SCIENCE AND TECHNOLOGY (KUST)

61A LECTURE 1 FUNCTIONS, VALUES. Steven Tang and Eric Tzeng June 24, 2013

Spring 2018 El Camino College E. Ambrosio. Course Syllabus

CSE 504: Compiler Design

Central Washington University Department of Computer Science Course Syllabus

Computer Science II Data Structures

CS 1803 Pair Homework 3 Calculator Pair Fun Due: Wednesday, September 15th, before 6 PM Out of 100 points

Definite Loops. Computer Science S-111 Harvard University David G. Sullivan, Ph.D. Using a Variable for Counting

Course Announcements cs2220: Engineering Software

Boca Raton Community High School AP Computer Science A - Syllabus 2009/10

CENG 707 Data Structures and Algorithms

Introduction to Computer Systems

You can delete the default blank background by clicking on its Delete button.

Lecture 1: CSE 373. Data Structures and Algorithms

B. Subject-specific skills B1. Problem solving skills: Supply the student with the ability to solve different problems related to the topics

CS240: Programming in C

Teaching Kids to Program. Lesson Plan: Catch the Ball

CS252 Advanced Programming Language Principles. Prof. Tom Austin San José State University Fall 2013

CS 4349 Lecture August 21st, 2017

Note: This is a miniassignment and the grading is automated. If you do not submit it correctly, you will receive at most half credit.

CS 202: Introduction to Computation Fall 2010: Exam #1

CSE 167: Introduction to Computer Graphics. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2016

CSCI 1100L: Topics in Computing Lab Lab 11: Programming with Scratch

CompSci 125 Lecture 02

COP 1220 Introduction to Programming in C++ Course Justification

EECS 282 Information Systems Design and Programming. Atul Prakash Professor, Computer Science and Engineering University of Michigan

Syllabus COSC-051-x - Computer Science I Fall Office Hours: Daily hours will be entered on Course calendar (or by appointment)

COMP250: Introduction to Computer Science. Jérôme Waldispühl & Carlos Oliver Gonzalez School of Computer Science McGill University

Abstract Data Types and Data Structures

Programming Languages and Compilers (CS 421)

SCRATCH MODULE 3: NUMBER CONVERSIONS

Course Administration

CSC D84 Assignment 2 Game Trees and Mini-Max

AP Computer Science A: Java Programming

CSCI 136: Fundamentals of Computer Science II. Keith Vertanen Museum

Tutorials. Tutorial every Friday at 11:30 AM in Toldo 204 * discuss the next lab assignment

CSE 336. Introduction to Programming. for Electronic Commerce. Why You Need CSE336

Lecture 2. COMP1406/1006 (the Java course) Fall M. Jason Hinek Carleton University

CS Introduction to Programming Fall 2016

CSCD18: Computer Graphics. Instructor: Leonid Sigal

CSC 111 Introduction to Computer Science (Section C)

CS 106A, Lecture 27 Final Exam Review 1

CS 432 Fall Mike Lam, Professor. Compilers. Advanced Systems Elective

Computer Science II Lecture 1 Introduction and Background

Welcome! COMS 4118 Opera3ng Systems I Spring 2018

Scratch Lesson 2: Movies Made From Scratch Lesson Framework

Object Oriented Programming

CS 240 Fall Mike Lam, Professor. Just-for-fun survey:

EECE.2160: ECE Application Programming Spring 2017

Unit 5: Computer Networking CS 101, Fall 2018

CS 111X - Fall Test 1

Ascii Art. CS 1301 Individual Homework 7 Ascii Art Due: Monday April 4 th, before 11:55pm Out of 100 points

Programming 2. Outline (112) Lecture 0. Important Information. Lecture Protocol. Subject Overview. General Overview.

1001ICT Introduction To Programming Lecture Notes

Announcements. Course syllabus Tutorial/lab signup form (due 4pm today) Lecture 1 notes Homework 1 Initial assessment

Course Syllabus. Course Information

[301] Introduction. Tyler Caraza-Harter

CS 455 Midterm Exam 1 Fall 2016 [Bono] Thursday, Sept. 29, 2016

CONTENTS: What Is Programming? How a Computer Works Programming Languages Java Basics. COMP-202 Unit 1: Introduction

PCS1-Ch-3B-Basic-Loops-HW CSCI 1320 Initials P a g e 1

ECE573 Introduction to Compilers & Translators

Building Java Programs

Inf1-OOP. Textbooks. Who and What. Organizational Issues. Why Java? Course Overview. Hello, World! in Java. Ewan Klein, Perdita Stevens

CMSC 132: Object-Oriented Programming II. Administrivia

COSE212: Programming Languages. Lecture 0 Course Overview

Philadelphia University Faculty of Information Technology Department of Computer Science --- Semester, 2007/2008. Course Syllabus

CIS*1500 Introduction to Programming

CS 3813/718 Fall Python Programming. Professor Liang Huang.

Transcription:

Unit 1, Part 1 Intensive Introduction to Computer Science Course Overview Programming in Scratch Computer Science S-111 Harvard University David G. Sullivan, Ph.D. Welcome to CS S-111! Computer science is not so much the science of computers as it is the science of solving problems using computers. Eric Roberts This course covers: the process of developing algorithms to solve problems the process of developing computer programs to express those algorithms fundamental data structures for imposing order on a collection of information the process of comparing data structures & algorithms for a given problem

Computer Science and Programming There are many different fields within CS, including: software systems computer architecture networking programming languages, compilers, etc. theory AI Experts in many of these fields don t do much programming! However, learning to program will help you to develop ways of thinking and solving problems used in all fields of CS. A Rigorous Introduction Intended for: those who plan to work extensively with computers future concentrators who plan to take more advanced courses others who want a rigorous introduction no programming background required, but can also benefit people with prior background Allow for 20-30 hours of work per week start work early! come for help! don't fall behind! Computer Science S-1 is a less rigorous alternative

Lectures and sections CS 111 Requirements Ten problem sets (50%) part I = "written" problems part II = "programming" problems grad-credit students will have extra work on most assts. Nine unit tests (25%) given at the end of lecture (see the schedule) 25 possible pts. for each if score lower than 18, can take a retest for a max. of 18 Final exam (25%): Friday, August 4, 8:30-11:30 a.m. comprehensive exam Textbooks Required: The CSCI S-111 Coursepack contains all of the lecture notes will be available at Gnomon Copy on Mass Ave. Optional resource for the first half: Building Java Programs by Stuart Reges and Marty Stepp (Addison Wesley, 2016). Optional resource for the second half: Data Structures & Algorithms in Java, 2nd edition by Robert Lafore (SAMS Publishing, 2003).

Other Course Staff Teaching Assistants (TAs): Cody Doucette (head TA) Caitlin Fournier Justin Ingwersen Eli Saracino See the course website for contact info. Piazza is your best bet for questions. For purely administrative questions: libs111@fas.harvard.edu will forward your email to the full course staff Other Details of the Syllabus Schedule: note the due dates and test dates no lectures or sections on most Wednesdays exceptions: July 5 (July 4 is off), July 12 (July 14 is off), August 2 (August 3 is off) Policies: 10% penalty for submissions that are one day late please don't request an extension unless it's an emergency! grading Please read the syllabus carefully and make sure that you understand the policies and follow them carefully. Let us know if you have any questions.

Algorithms In order to solve a problem using a computer, you need to come up with one or more algorithms. An algorithm is a step-by-step description of how to accomplish a task. An algorithm must be: precise: specified in a clear and unambiguous way effective: capable of being carried out Example of Defining an Algorithm

Programming Programming involves expressing an algorithm in a form that a computer can interpret. We will primarily be using the Java programming language. one of many possible languages The key concepts of the course transcend this language. What Does a Program Look Like? Here's a Java program that displays a simple message: public class HelloWorld { public static void main(string[] args) { System.out.println("hello, world"); } } Like all programming languages, Java has a precise set of rules that you must follow. the syntax of the language To quickly introduce you to a number of key concepts, we will begin with a simpler language.

Scratch A simple graphical programming language developed at the MIT Media Lab easy enough for middle school kids makes it easy to create animations, games, etc. Download version 1.4 for free here: http://scratch.mit.edu/scratch_1.4/ this is not the latest version, but it's the one we will use Scratch Basics Scratch programs (scripts) control characters called sprites. Sprites perform actions and interact with each other on the stage. the stage building blocks for programs/ scripts drag building blocks here to create scripts

Sprites At the start, there is a single cat sprite on the stage. You can add and remove sprites, and change their costumes. new sprite buttons list of sprites on the stage Clicking on a sprite from the list below the stage shows you the scripts for that sprite (if any). Program Building Blocks Grouped into eight color-coded categories The shape of a building block indicates where it can go. Right-click a building block to get help on that type of block.

Program Building Blocks: Statements Statement = a command or action Statements have bumps and/or notches that allow you to stack them. each stack is a single script A statement may have: an input area that takes a value (Hello!, 10, 15, etc.) a pull-down menu with choices (meow) Program Building Blocks: Statements (cont.) Clicking on any statement in a script executes the script. When rearranging blocks, dragging a statement drags it and any other statements below it in the stack. example: dragging the wait command below

Flow of Control Flow of control = the order in which statements are executed By default, statements in a script are executed sequentially from top to bottom when the script is clicked. Control blocks (gold in color) allow you to affect the flow of control. simple example: the wait statement above pauses the flow of control Flow of Control: Repetition Many control statements are C-shaped, which allows them to control other statements. Example: statements that repeat other statements. Drag statements inside the opening to create a repeating stack. forms In programming, a group of statements that repeats is known as a loop.

Flow of Control: Responding to an Event Hat blocks (ones with rounded tops) can be put on top of a script. They wait for an event to happen. when it does, the script is executed What Does a Program Look Like? Recall our earlier Java program: public class HelloWorld { public static void main(string[] args) { System.out.println("hello, world"); } } Here's the Scratch version and here's the result:

Stage Coordinates Dimensions: 480 units wide by 360 units tall Center has coordinates of 0, 0 What Does This Program Draw?

What Changes Are Needed to Draw Each of These? Flow of Control: Repeating a Repetition! One loop inside another loop! known as a nested loop How many times is the move statement executed above?

Making Our Program Easier to Change It would be nice to avoid having to manually change all of the numbers. Take advantage of relationships between the numbers. what are they? Program Building Blocks: Variables A variable is a named location in the computer's memory that is used to store a value. Can picture it as a named box: To create a variable:

Using Variables in Your Program note: you must drag a variable into place, not type its name Program Building Blocks: Operators Operators create a new value from existing values/variables.

Our Program with Variables and Operators Getting User Input Use the ask command from the sensing category. The value entered by the user is stored in the special variable answer, which is also located in the sensing category. Allowing the user to enter numsides and numcopies:

Program Building Blocks: Boolean Expressions Blocks with pointed edges produce boolean values: true or false Boolean operators: There are also boolean expressions in the sensing palette: Flow of Control: Conditional Execution conditional execution = deciding whether to execute one or more statements on the basis of some condition There are C-shaped control blocks for this: They have an input area with pointed edges for the condition.

Flow of Control: Conditional Execution (cont.) If the condition is true: the statements under the if are executed the statements under the else are not executed If the condition is false: the statements under the if are not executed the statements under the else are executed Dealing With Invalid User Inputs

More Info on Scratch Documentation is available online: getting started guide for version 1.4: http://download.scratch.mit.edu/scratchgettingstartedv14.pdf reference guide for version 1.4: http://download.scratch.mit.edu/scratchreferenceguide14.pdf Creating a Scratch account is not required for this course.