Week_1_GettingStarted

Week_1_GettingStarted - CMPT120 J. Ye Introduction to...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
CMPT120 J. Ye Introduction to Computing Science and Programming (Week 1 Getting Started) What this course is about Algorithms Computing Science Basics How Computers represent information Programming and Python Basics CMPT120 J. Ye Some figures are from J. Glenn Brookshear’s book An Overview of Computer Science As a complex system, computers can be viewed from a number of perspectives, or levels: User Level: Application Programs High Level Languages Assembly Language / Machine Code Functional Units: Memory, ALU, . .. Logic gates Transistors and Wires Low High 2 Different levels of viewing a computer
Background image of page 1

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

View Full DocumentRight Arrow Icon
CMPT120 J. Ye This course is not about how to use computers or any application software This course is not (only) about Python (we just use Python to introduce programming concepts) 3 What this course is NOT about? Basic ideas of computing science algorithms; programs; data representation; running time; . .. Basic ideas of computer programming Basic concepts: variables; references; functions; data types; variable scope; … basic data structure: lists (and strings ) basic control structures: conditional statements; loops; Create algorithms to solve simple problems Implement computer programs in Python Design programs that are easy to understand and maintain 4 What this course IS about?
Background image of page 2
CMPT120 J. Ye A simple version: An algorithm is a set of instructions for solving a problem A formal version: “An algorithm is a sequence of unambiguous instructions for solving a problem, i.e., for obtaining a required output for any valid input in a finite amount of time .” 5 What is an algorithm? Algorithms can be expressed using: Plain English usually in a step-by-step fashion Pseudecode almost code Flowchart a type of diagram that can be used to show how “things” work (will be discussed later in the course) 6 Algorithms
Background image of page 3

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

View Full DocumentRight Arrow Icon
CMPT120 J. Ye 7 Algorithm Example #1 (from Study Guide) Algorithms 1. Tell the user to pick a secret integer between 1 and 100. 2. The smallest possible integer is 1; the largest possible is 100 3. Make a guess that is halfway between the smallest and largest 4. Ask the user if the guess is too large, too small or correct. 5. If they say it is correct, the game is over.
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 18

Week_1_GettingStarted - CMPT120 J. Ye Introduction to...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online