Announcements Tues., Aug and 2. to call them ( ) ! For next time, read Learning Computing with Robots, chs.

Similar documents
Outline. Introduction to Programming (in C++) Introduction. First program in C++ Programming examples

Topic I. Introduction and motivation References: Chapter 1 of Concepts in programming languages by J. C. Mitchell. CUP, 2003.

Concepts in Programming Languages

Low-Level Languages. Computer Programs and Programming Languages

Introduction. A. Bellaachia Page: 1

General Concepts. Abstraction Computational Paradigms Implementation Application Domains Influence on Success Influences on Design

Introduction to Computer Science I

CP122 CS I. Chapter 1: Introduction

SKILL AREA 304: Review Programming Language Concept. Computer Programming (YPG)

CP122 CS I. Hello, World!

Programming Paradigms

CS102 Unit 2. Sets and Mathematical Formalism Programming Languages and Simple Program Execution

Lecture 1: Introduction

Discovering Computers 2008

Welcome to Introduction to Computer Science I

Languages october 22, 2017 Éric Lévénez < FORTRAN III end-1958 FORTRAN II FORTRAN I october 1956

Principles in Programming: Orientation & Lecture 1. SWE2004: Principles in Programming Spring 2014 Euiseong Seo

Introduction Jan. 22, Ch 1

8/27/17. CS-3304 Introduction. What will you learn? Semester Outline. Websites INTRODUCTION TO PROGRAMMING LANGUAGES

Programming Language Concepts 1982, 1987, Outline. Period

CS2303 C14 Systems Programming Concepts. Bob Kinicki

SOFTWARE ARCHITECTURE 6. LISP

Högnivåspråk och översättning

! Broaden your language horizons! Different programming languages! Different language features and tradeoffs. ! Study how languages are implemented

COSC 2P90 Programming Languages & Object-Orientation

Language Translation, History. CS152. Chris Pollett. Sep. 3, 2008.

Chapter 5 Names, Binding, Type Checking and Scopes

CSCI 3136 Principles of Programming Languages

Chapter 1: Why Program? Computers and Programming. Why Program?

Objective: To learn meaning and concepts of programming. Outcome: By the end of this students should be able to describe the meaning of programming

Introduction to Scientific Computing Languages

Faculty of Mechanical Engineering UTM

CSc 372 Comparative Programming Languages

Introduction to Scientific Computing Languages

COMPILER DESIGN LECTURE NOTES

CS 3304 Comparative Languages. Lecture 1: Introduction

CS1 Lecture 2 Jan. 16, 2019

Why are there so many programming languages? Why do we have programming languages? What is a language for? What makes a language successful?

Informal Semantics of Data. semantic specification names (identifiers) attributes binding declarations scope rules visibility

Programming Languages, Summary CSC419; Odelia Schwartz

! Broaden your language horizons. ! Study how languages are implemented. ! Study how languages are described / specified

assembler Machine Code Object Files linker Executable File

Principles in Programming: Orientation & Lecture 1. SWE2004: Principles in Programming Spring 2015 Euiseong Seo

Chapter 1: An Introduction to Computer Science. Invitation to Computer Science, C++ Version, 6-th Edition

Programmiersprachen (Programming Languages)

COMP 201: Principles of Programming

A brief survey of programming languages: motivation and design/ continued. Lecture 3. Even more, Algol, Cobol. Are they really different?

Logic Programming II & Revision

PROGRAMMING LANGUAGE PARADIGMS & THE MAIN PRINCIPLES OF OBJECT-ORIENTED PROGRAMMING

Part (04) Introduction to Programming

Structured Programming Using C++ Lecture 2 : Introduction to the C++ Language. Dr. Amal Khalifa. Lecture Contents:

Ch 1. Algorithms and Basic C++ Programming

Continuations provide a novel way to suspend and reexecute

ITC213: STRUCTURED PROGRAMMING. Bhaskar Shrestha National College of Computer Studies Tribhuvan University

CSC 326H1F, Fall Programming Languages. What languages do you know? Instructor: Ali Juma. A survey of counted loops: FORTRAN

St. MARTIN S ENGINEERING COLLEGE Dhulapally, Secunderabad

Assembly Language for Intel-Based Computers, 4 th Edition. Chapter 1: Basic Concepts

Fundamentals of Programming. Lecture 1: Introduction + Basic Building Blocks of Programming

Why are there so many programming languages?

Early computers (1940s) cost millions of dollars and were programmed in machine language. less error-prone method needed

Control Flow February 9, Lecture 7

Programming Languages

Foreword. Agenda 22/09/2009 INTRODUCTION TO VBA PROGRAMMING. Foundations. Tools

CSC 533: Organization of Programming Languages. Spring 2005

CSc 10200! Introduction to Computing. Lecture 1 Edgardo Molina Fall 2013 City College of New York

How Many Programming Languages are there in this World? CS 199 Computers Unplugged. What is a Programming Language? What is a Programming Language?

What is programming? Elements of Programming Languages. From machine code to programming languages. What is a programming language?

Java Programming. What is a program? Programs Recipes. Programs as Recipes 8/16/12. Pancakes In one bowl. mix: 1½ cup flour

Chapter7 Expression and Assignment Statement. Introduction

Chapter 1. C++ Basics. Copyright 2010 Pearson Addison-Wesley. All rights reserved

Organization of Programming Languages (CSE452) Why are there so many programming languages? What makes a language successful?

PHYS 4361 DR. Maher O. El-Ghossain Associate Professor. 1/31/ :24:07 PM Dr Maher O. El-Ghossain 1

Software. Programming Languages. Types of Software. Types of Languages. Types of Programming. Software does something

This watermark does not appear in the registered version - Slide 1

A Tour of Language Implementation

CS103 Lecture 1 Slides. Introduction Mark Redekopp

SAMS Programming - Section C. Lecture 1: Introduction + Basic Building Blocks of Programming

1. true / false By a compiler we mean a program that translates to code that will run natively on some machine.

CS 330 Lecture 18. Symbol table. C scope rules. Declarations. Chapter 5 Louden Outline

Compilation 2012 The What and Why of Compilers

Topic 1: Programming concepts

Programming (ERIM) Lecture 1: Introduction to programming paradigms and typing systems. Tommi Tervonen

7/8/10 KEY CONCEPTS. Problem COMP 10 EXPLORING COMPUTER SCIENCE. Algorithm. Lecture 2 Variables, Types, and Programs. Program PROBLEM SOLVING

CS103 Lecture 1 Slides. Introduction Mark Redekopp

G Programming Languages - Fall 2012

Com S 541. Programming Languages I

Lecture 1: Course Introduction

Programming Languages 2nd edition Tucker and Noonan"

Chapter 1: An Introduction to Computer Science

Lecture 09. Ada to Software Engineering. Mr. Mubashir Ali Lecturer (Dept. of Computer Science)

Introduction P L COS 301. Fall School of Computing and Information Science University of Maine. Introduction COS 301.

CSE 201 Java Programming I. Smart Coding School website:

Exercise 1.1 Hello world

MIDTERM EXAMINATION - CS130 - Spring 2005

Algorithms and Programming Languages

(0) introduction to the course. how to learn a programming language. (0) course structure

CSc 520. Course Outline (Subject to change) Course Outline (Subject to change)... Principles of Programming Languages. Christian Collberg

Introduction to Computer Science

Your First C++ Program. September 1, 2010

CS 102 Lecture 1. Syllabus, history, intro

Transcription:

Announcements Tues., Aug. 24! For next time, read Learning Computing with Robots, chs. 1 and 2.! The Blackboard site is up and operational!! not much content! mostly links back to my course homepage! Printed copies will be available from Graphic Creations! 1809 Lake Avenue, Knoxville! How to Think Like a Computer Scientist: $20! Learning Computing with Robots: $30! I don t know if they print copies in advance; you might want to call them (522-6221)! CS 102 vs. CS 100 2010-08-24 1

The Algorithm Slides (with modifications) from ( IPRE ) Institute for Personal Robots in Education 2 2010-08-24 CS 102 with Robots

The Algorithm Algorithm: n. A finite set of unambiguous instructions performed in a prescribed sequence to achieve a goal The American Heritage Science Dictionary 2010-08-24 3

The Algorithm Al-Khwarizmi was a Persian mathematician who wrote a book on calculating with Hindu numerals in the 9th century CE. When translated to Latin, a pluralized form of his name (algorismus) became synonymous with a system of calculation. 2010-08-24 4

( Algorithm ) Pizza Dough Recipe 1. Gather Ingredients 2. Combine sugar (1tbs), salt (1tbs), olive oil (1tbs), flour (1c) in mixing bowl 3. Turn on mixer 4. Add 1/4 cup of flour 5. If dough comes off the sides go to step 6, otherwise go back to step 4 6. Knead 15 minutes 7. Let rest for at least 45 minutes in warm area 1 dough ball 2010-08-24 5

N-Pizza Dough Algorithm 1. 1. Gather Ingredients 2. 2. Combine sugar (N tbs), salt (N tbs), olive oil (N tbs), flour (N c) in mixing bowl 3. 3. Turn on mixer 4. 4. Add N/4 cup of flour 5. 5. If dough comes off the sides go to step 6, otherwise go back to step 4 6. 6. Knead 15 minutes 7. 7. Let rest for at least 45 minutes in warm area N dough balls 2010-08-24 6

N-Pizza Dough Algorithm! 1. Gather Ingredients! 2. Combine sugar (N tbs), salt (N tbs), olive oil (N tbs), flour (N c) in mixing bowl! 3. Turn on mixer! 4. Add N/4 cup of flour! 5. If dough comes off the sides go to step 6, otherwise go back to step 4! 6. Knead 15 minutes! 7. Let rest for at least 45 minutes in warm area Sequence of Statements N dough balls 2010-08-24 7

N-Pizza Dough Algorithm! 1. Gather Ingredients! 2. Combine sugar (N tbs), salt (N tbs), olive oil (N tbs), flour (N c) in mixing bowl! 3. Turn on mixer! 4. Add N/4 cup of flour! 5. If dough comes off the sides go to step 6, otherwise go back to step 4! 6. Knead 15 minutes! 7. Let rest for at least 45 minutes in warm area Variable N dough balls 2010-08-24 8

N-Pizza Dough - Algorithm! 1. Gather Ingredients! 2. Combine sugar (N tbs), salt (N tbs), olive oil (N tbs), flour (N c) in mixing bowl! 3. Turn on mixer! 4. Add N/4 cup of flour! 5. If dough comes off the sides go to step 6, otherwise go back to step 4! 6. Knead 15 minutes! 7. Let rest for at least 45 minutes in warm area Conditional 2010-08-24 9

N-Pizza Dough - Algorithm! 1. Gather Ingredients! 2. Combine sugar (N tbs), salt (N tbs), olive oil (N tbs), flour (N c) in mixing bowl! 3. Turn on mixer! 4. Add N/4 cup of flour! 5. If dough comes off the sides go to step 6, otherwise go back to step 4! 6. Knead 15 minutes! 7. Let rest for at least 45 minutes in warm area Subroutines Mini-algorithms N dough balls 2010-08-24 10

Programs - Algorithms at Work! Programs are the way we communicate with a computer! Specify the algorithm! This class uses the C++ programming language! Rather than pizza dough, we will use a robot as our favorite example 2010-08-24 11

The Way of the Program 12 2010-08-24 CS 102 with Robots

Programming languages! There are thousands of programming languages!! High-level languages:! These are some languages I have programmed in: A, Ada, Algol 60, Algol 68, APL, Argot, BASIC, BCPL, Bliss, Chrysalis, COBOL, C++, FORTRAN, FP, GPL, LISP, Mathematica, NetLogo, Pascal, ϕ, PL/M, Prolog, Python, Scheme, Simula 67, Smalltalk, StarLogo, Ω.! These are some well-known and popular languages that I have not programmed in: C, C#, Forth, Haskel, Java, MatLab, Miranda, Pearl, PL/I.! The point? In your career you will have to learn and use many HLLs!! The key skill is how to program! You should also be able to pick up new HLLs quickly! There are also low-level languages 2010-08-24 13

Interpreters 2010-08-24 14

Compiler 2010-08-24 15

What is a program?! A program is a sequence of instructions for performing a computation! That is, a precise description of an algorithm! Instructions include:! input! output! math! testing! repetition! Programs need to be comprehensible to people as well as computers! 2010-08-24 16

Debugging! Compile-time errors! Run-time errors! Logic errors! Experimental debugging (hypothesis testing) 2010-08-24 17

Formal vs. natural languages! Natural languages! ambiguity! redundancy! literalness! Formal languages! Programming languages are formal languages for expressing algorithms 2010-08-24 18

A first program Hello World #include <iostream> using namespace std; // main: generate some simple output int main () { cout << "Hello, world." << endl; } return 0; Embodiment 2010-08-24 19