CHAPTER 1 Overview of Programming and Problem Solving.

Slides:



Advertisements
Similar presentations
Agenda Definitions Evolution of Programming Languages and Personal Computers The C Language.
Advertisements

ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Lecture 1: Overview of Computers & Programming
Overview of Programming and Problem Solving ROBERT REAVES.
Overview. What is Computer Programming? It is the process of planning a sequence of steps (called instructions) for a computer to follow. 2 STEP 1 STEP.
Computer Science-I (CSIT121) Dr. Junaid Ahmed Zubairi SUNY at Fredonia Room 210, Fenton ,
1 Chapter 1 Introduction to Object-Oriented Programming.
1 Chapter 1 Overview of Programming and Problem Solving Dale/Weems Slides based on work by Sylvia Sorkin, Community College of Baltimore County - Essex.
This set of slides is provided by the author of the textbook1 Introductory Topics l Computer Programming l Programming Life-Cycle Phases l Creating an.
Chapter 1 Introduction to Object- Oriented Programming and Problem Solving.
1 Lecture 1  Getting ready to program  Hardware Model  Software Model  Programming Languages  The C Language  Software Engineering  Programming.
Chapter 16 Programming and Languages: Telling the Computer What to Do.
Chapter 1: An Overview of Computers and Programming Languages
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages C++ Programming:
1 Chapter 1 Overview of Programming and Problem Solving Dale/Weems/Headington Slides by Sylvia Sorkin, Community College of Baltimore County - Essex Campus.
CHAPTER 1: AN OVERVIEW OF PROGRAMMING INSTRUCTOR: MOHAMMAD MOJADDAM How to Program in C++
CS 115 Chapter 1 Overview of Programming and Problem Solving.
Principles of Programming Chapter 1: Introduction  In this chapter you will learn about:  Overview of Computer Component  Overview of Programming 
1 Chapter 1 Overview of Programming and Problem Solving Slides based on work by Sylvia Sorkin, Community College of Baltimore County - Essex Campus.
1 Author: Nell Dale Chip Weems Mark Headington Published By Higher Education Press Jones and Bartlett Publishers.
Programming Languages: Telling the Computers What to Do Chapter 16.
1 Chapter 1 Overview of Programming and Problem Solving Dale/Weems Slides based on work by Sylvia Sorkin, Community College of Baltimore County - Essex.
Chapter 1: Preliminaries. Objectives In this chapter, you will learn about: Unit analysis Exponential and scientific notations Software development Algorithms.
Chapter 3: Completing the Problem- Solving Process and Getting Started with C++ Introduction to Programming with C++ Fourth Edition.
1 Overview of Programming and Problem Solving Chapter 1.
CMPE13Cyrus Bazeghi 1 Programming Languages Telling computers what to do.
Programming With C.
Introduction to C++ Programming Language
Overview of Programming and Problem Solving Textbook Chapter 1 1.
IXA 1234 : C++ PROGRAMMING CHAPTER 1. PROGRAMMING LANGUAGE Programming language is a computer program that can solve certain problem / task Keyword: Computer.
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages.
INTRODUCTION TO COMPUTING CHAPTER NO. 04. Programming Languages Program Algorithms and Pseudo Code Properties and Advantages of Algorithms Flowchart (Symbols.
Programming Fundamentals1 Chapter 1 INTRODUCTION TO COMPUTER AND PROGRAMMING.
1 Chapter 1 Overview of Programming and Problem Solving Dale/Weems/Headington.
Liang, Introduction to C++ Programming, (c) Chapter 1 Introduction to Computers, Programs, and C++
Chapter 1 Overview of Programming and Problem Solving Slides based on work by Sylvia Sorkin, Community College of Baltimore County - Essex Campus.
Lecture 11: 10/1/2002CS149D Fall CS149D Elements of Computer Science Ayman Abdel-Hamid Department of Computer Science Old Dominion University Lecture.
Chapter 1 Overview of Programming and Problem Solving 1.
1 Chapter 1 Overview of Programming and Problem Solving Dale/Weems Slides based on work by Sylvia Sorkin, Community College of Baltimore County - Essex.
CS Computer Science I. BCPL was developed in 1967 as a language for writing operating systems and software compilers In 1970, the creators of the.
1 Chapter 1 Overview of Programming and Problem Solving Slides based on work by Sylvia Sorkin, Community College of Baltimore County - Essex Campus.
Programming in C++ Dale/Weems/Headington Chapter 1 Overview of Programming and Problem Solving.
Chapter 1 Overview of Programming and Problem Solving CS185/09 - Introduction to Programming Caldwell College.
Chapter 1 Computers, Compilers, & Unix. Overview u Computer hardware u Unix u Computer Languages u Compilers.
Principles of Programming Chapter 1: Introduction  In this chapter you will learn about:  Overview of Computer Component  Overview of Programming 
LESSON 1 Introduction to Programming Language. Computer  Comprised of various devices that are referred to as HARDWARE.  The computer programs that.
1 Overview of Programming Principles of Computers.
Chapter 11  Getting ready to program  Hardware Model  Software Model  Programming Languages  Facts about C++  Program Development Process  The Hello-world.
An overview of C Language. Overview of C C language is a general purpose and structured programming language developed by 'Dennis Ritchie' at AT &T's.
Chapter 1 An Overview of Computers and Programming Languages.
Evolution of C and C++ n C was developed by Dennis Ritchie at Bell Labs (early 1970s) as a systems programming language n C later evolved into a general-purpose.
PROGRAMMING FUNDAMENTALS INTRODUCTION TO PROGRAMMING. Computer Programming Concepts. Flowchart. Structured Programming Design. Implementation Documentation.
INTRODUCTION TO COMPUTER PROGRAMMING(IT-303) Basics.
1 Structured Programming Arab Academy for Science and Technology CC112 Dr. Sherif Mohamed Tawfik The Course.
Software Engineering Algorithms, Compilers, & Lifecycle.
1 Chapter 1 Overview of Programming and Problem Solving Slides based on work by Sylvia Sorkin, Community College of Baltimore County - Essex Campus.
Cosc175 - lec11 Overview History Hardware Software Software Development Life Cycle Programming Languages Structured Programming Defining the Problem.
LESSON 1 Introduction to Programming Language
Chapter 1 Overview of Programming and Problem Solving
Chapter 1: An Overview of Computers and Programming Languages
C++ Programming: From Problem Analysis to Program Design
Chapter 1 Overview of Programming and Problem Solving
Chapter 1 Introduction(1.1)
What is Computer Programming?
Overview History Hardware Software Software Development Life Cycle
Introduction to Computer Programming
Chapter 1: Preliminaries
Presentation transcript:

CHAPTER 1 Overview of Programming and Problem Solving

What is a computer program? What is programming? l PROGRAM –list of instructions to be performed by computer l PROGRAMMING –planning sequence of steps for computer to follow.

List the three phases of developing computer programs. l 1) Problem-Solving phase –Analysis & Specification Define the problem Define what the solution must do –General solution (algorithm) steps to solve problem –Verify Does solution actually solve the problem?

3 phases of developing pgms l 2) Implementation –Translate algorithm into programming language –Program tested –Errors corrected

3 phases of developing pgms l 3) MAINTENANCE CHANGE?? –Correction defects –Adaptation changes in ext. environment –Enhancement extend functionality

A Tempting Shortcut? GOAL THINKING CODE REVISE DEBUG TEST CODE Shortcut?

What is an algorithm? l step-by-step procedure l solves problem in finite time l e.g., Washing hair, recipes, CHILTON'S

What is a programming language? l Set of –rules –symbols –keywords l used to construct a program. ALGORITHM LANGUAGE PROGRAM

What is documentation? l Text and comments l making program easier l for others to understand, l use, and modify.

Define Bit, Byte. l Bit –a binary digit, 1 or 0 l Byte –a group of bits, usually 8

11 Bit Permutations 1 bit bits bits bits Each additional bit doubles the number of possible permutations

Bits, Binary System, Byte l All computer data is stored as a sequence of bits. l The binary (base-two) number system represents computer bits as numbers. l A byte can store 256 different combinations. 256 = 2 8

Contrast machine language, assembly language, and high- level languages. l Machine language –binary coded instructions –used directly by computer l C

l Assembly language –low level language –mnemonics –represents machine language instructions for a particular computer MOV X, 5

l High Level language –statements resemble spoken languages –or mathematical notation l Pascal, FORTRAN, COBOL, C++, BASIC, C

l C++: X = 5; l Assembly:mov word ptr [x], 5 l Machine:C l Binary: l

List advantages of high-level programming language? l Easier to use –(closer to English / Math) l Solve problems faster l Portable –(may run on many machines)

What does a compiler do? an assembler? l A compiler translates a high level language program into machine code. l An assembler translates an assembly language program into machine code. C++ Pgm MS Visu C++ Compiler PC machine language

Three C++ Program Stages other code from libraries, etc. other code from libraries, etc. written in machine language written in machine language written in machine language written in machine language written in C++ written in C++ via compilervia linker SOURCEOBJECT EXECUTABLE myprog.cppmyprog.objmyprog.exe

Origins of C++ l C –Dennis Ritchie developed at Bell Labs –Late 1960s –Systems programming language (90% Unix) l C++ –Bjarne Stroustrup of Bell Labs –1985 –Object-oriented features added

Some C++ History l 1972 : Dennis Ritchie at Bell Labs designs C and 90% of UNIX is then written in C l Late 70’s : OOP becomes popular l Bjarne Stroustrup at Bell Labs adds features to C to form “C with Classes” l 1983 : Name C++ first used l 1998 : ISO/ANSI standardization of C++

List four basic control structures used in programming. l SEQUENCE –series of statements –one statement executed after another –(wash hair algorithm)

SEQUENCE Statement...

l SELECTION –executes statements depending upon certain conditions

SELECTION (branch) IF Condition THEN Statement1 ELSE Statement2 Statement1 Statement Statement2 Condition... True False

l LOOP –repeats statements while certain conditions are met

LOOP (repetition) Statement Condition... False True WHILE Condition DO Statement1

l PROCEDURE –breaks up a program into smaller subprograms

SUBPROGRAM (function) SUBPROGRAM1... SUBPROGRAM1 a meaningful collection of SEQUENCE, SELECTION, LOOP, SUBPROGRAM

What is Computer Science? The Computing Curriculum 1991 (ACM/IEEE) l Algorithms and Data Structures l Architecture l Artificial Intelligence and Robotics l Database and Information Retrieval l Human-Computer Communication l Numerical and Symbolic Computation l Operating Systems l Programming Languages l Software Engineering l Social and Professional Context

Drawing in Processing Automatic creation of display window Window has a coordinate system for drawing

Let's draw a point: point() point(x, y) – draws a point at the location x, y Try it in Processing: point(50, 50) Unexpected token: null Compiler errors appear in the bottom pane All lines must be terminated with a semicolon ; Try drawing several points