{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Comp Sci 31

# Comp Sci 31 - CS 31 Introduction to Computer Science I...

This preview shows pages 1–14. Sign up to view the full content.

CS 31: Introduction To CS I Topic 1: Introduction to Programming 1/2010 John A. Rohr All Rights Reserved JAR 1-1 CS 31 : Introduction to Computer Science I Topic 1 Introduction to Programming

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
CS 31: Introduction To CS I Topic 1: Introduction to Programming 1/2010 John A. Rohr All Rights Reserved JAR 1-2 Introduction to Programming PROGRAMMING PROCESS EXAMPLE Driving a Car
CS 31: Introduction To CS I Topic 1: Introduction to Programming 1/2010 John A. Rohr All Rights Reserved JAR 1-3 Introduction to Programming Programming Process Example Types of Contol Sequential: Step-by-step Selection: One of choices Repetition: Repeated step

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
CS 31: Introduction To CS I Topic 1: Introduction to Programming 1/2010 John A. Rohr All Rights Reserved JAR 1-4 Program Control Flow Sequential One Step at a Time Begin End Compute Compute Compute Compute
CS 31: Introduction To CS I Topic 1: Introduction to Programming 1/2010 John A. Rohr All Rights Reserved JAR 1-5 Program Control Flow Selection One of Choices Compute Compute Condition Begin End

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
CS 31: Introduction To CS I Topic 1: Introduction to Programming 1/2010 John A. Rohr All Rights Reserved JAR 1-6 Program Control Flow Repetition Repeated Step Begin End Condition Initialize Compute Update
CS 31: Introduction To CS I Topic 1: Introduction to Programming 1/2010 John A. Rohr All Rights Reserved JAR 1-7 Program Control Flow Composition Replace any Sequential Step with Two or more Sequential Steps, a Selection, or a Repetition

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
CS 31: Introduction To CS I Topic 1: Introduction to Programming 1/2010 John A. Rohr All Rights Reserved JAR 1-8 Program Control Flow Composition Example Guess a Number Between 0 and 100
CS 31: Introduction To CS I Topic 1: Introduction to Programming 1/2010 John A. Rohr All Rights Reserved JAR 1-9 Program Control Flow Example Guess a Number Between 0 and 100 Set G to 50 G = N? N Y Done: G is N G < N? N Y Add C to G Set C to 25 Subtract C from G Divide C by 2 Start G is the current guess C is the current change N is the chosen number

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
CS 31: Introduction To CS I Topic 1: Introduction to Programming 1/2010 John A. Rohr All Rights Reserved JAR 1-10 Introduction to Programming Programming Steps 1. Specification: Description of the Task 2. Analysis: Understanding the Task 3. Test Data: Complete Set of Tests 4. Design: Data and Algorithms 5. Implement: Write the Program 6. Test and Debug: Make It Work
CS 31: Introduction To CS I Topic 1: Introduction to Programming 1/2010 John A. Rohr All Rights Reserved JAR 1-11 Algorithm Design Tools Flow Charts Pseudocode

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
CS 31: Introduction To CS I Topic 1: Introduction to Programming 1/2010 John A. Rohr All Rights Reserved JAR 1-12 Algorithm Design Flow Charts Graphical Symbols Easy to Visualize Flow Difficult to Draw in Comments Examples: Flow of Control Diagrams
CS 31: Introduction To CS I Topic 1: Introduction to Programming 1/2010 John A. Rohr All Rights Reserved JAR 1-13 Algorithm Design Flow Chart Example Guess a Number Between 0 and 100 Set G to 50 G = N?

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 81

Comp Sci 31 - CS 31 Introduction to Computer Science I...

This preview shows document pages 1 - 14. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online