Chapter 12: Computer Programming 1 Computer Programming Chapter 12.

Slides:



Advertisements
Similar presentations
Introduction to Programming in C++ John Galletly.
Advertisements

Chapter 12 Computer Programming
Chapter 12 Computer Programming.
Tutorial 12: Enhancing Excel with Visual Basic for Applications
Computers Are Your Future
CHAPTER 1: AN OVERVIEW OF COMPUTERS AND LOGIC. Objectives 2  Understand computer components and operations  Describe the steps involved in the programming.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
زبانهای برنامه سازی برنامه سازی پیشرفته ارائه دهنده دکتر سيد امين حسيني E.mail: Home page:
Computers Are Your Future © 2006 Prentice Hall, Inc.
Computers: Tools for an Information Age
Java Programming, 3e Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.
Programming Logic and Design, Introductory, Fourth Edition1 Understanding Computer Components and Operations (continued) A program must be free of syntax.
Chapter 1 Program Design
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Computer Programming.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Chapter 3 Planning Your Solution
An Overview of Computers and Programming
11 Computer Programming Section A Programming Basics CHAPTER
Programming Paradigms Imperative programming Functional programming Logic programming Event-driven programming Object-oriented programming A programming.
Computer Programming and Database Handout
© Paradigm Publishing Inc Chapter 12 Programming Concepts and Languages.
Computers Are Your Future Tenth Edition Chapter 11: Programming Languages & Program Development Copyright © 2009 Pearson Education, Inc. Publishing as.
1 Technology in Action Chapter 7 Behind the Scenes: Software Programming.
Java Programming, 2E Introductory Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.
1 Integrated Development Environment Building Your First Project (A Step-By-Step Approach)
Computers Are Your Future Tenth Edition Chapter 11: Programming Languages & Program Development Copyright © 2009 Pearson Education, Inc. Publishing as.
Programming Languages: Telling the Computers What to Do Chapter 16.
Computers Are Your Future Eleventh Edition
COMPUTER SOFTWARE Section 2 “System Software: Computer System Management ” CHAPTER 4 Lecture-6/ T. Nouf Almujally 1.
Understanding Computers Ch. 131 Chapter 13 Program Development and Programming Languages.
Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and Elizabeth Drake Chapter 2: Developing a Program.
CIS Computer Programming Logic
信息处理技术.
COMPUTER PROGRAMMING Source: Computing Concepts (the I-series) by Haag, Cummings, and Rhea, McGraw-Hill/Irwin, 2002.
©Xiaoying Gao, Peter Andreae First Java Program COMP 102 #2 2014T2 Xiaoying Sharon Gao Computer Science Victoria University of Wellington.
First Java Program COMP 102 #2 2015T2 Xiaoying Sharon Gao Computer Science Victoria University of Wellington.
Programming Lifecycle
CMPE13Cyrus Bazeghi 1 Programming Languages Telling computers what to do.
Computer Concepts 2014 Chapter 12 Computer Programming.
1 Chapter 13 Understanding Computers, 11 th Edition 13 Program Development and Programming Languages TODAY AND TOMORROW 11 th Edition CHAPTER.
© 2011 Pearson Addison-Wesley. All rights reserved. Addison Wesley is an imprint of Stewart Venit ~ Elizabeth Drake Developing a Program.
Computer Programs and Programming Languages What are low-level languages and high-level languages? High-level language Low-level language Machine-dependent.
Problem Solving Techniques. Compiler n Is a computer program whose purpose is to take a description of a desired program coded in a programming language.
Chapter 12 Computer Programming. Chapter Contents Chapter 12: Computer Programming 2  Section A: Programming Basics  Section B: Procedural Programming.
Chapter 12 Computer Programming. 12 Chapter 12: Computer Programming 2 Chapter Contents  Section A: Programming Basics  Section B: Procedural Programming.
Computer Concepts 2013 Chapter 12 Computer Programming.
Module 4 Part 2 Introduction To Software Development : Programming & Languages Introduction To Software Development : Programming & Languages.
Computer Concepts 2014 Chapter 12 Computer Programming.
Unit 11 Programming.
EXPLAIN THE CONCEPT OF PROGRAMMING. Programming Languages and Program Development Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall2.
1 Program Planning and Design Important stages before actual program is written.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
Chapter 4 Software. Chapter 4: Software Generations of Languages Each computer is wired to perform certain operations in response to an instruction. An.
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
Computer Concepts 2013 Chapter 12 Computer Programming.
CSI 1340 Introduction to Computer Science II Chapter 1 Software Engineering Principles.
1 The Software Development Process ► Systems analysis ► Systems design ► Implementation ► Testing ► Documentation ► Evaluation ► Maintenance.
PROGRAMMING FUNDAMENTALS INTRODUCTION TO PROGRAMMING. Computer Programming Concepts. Flowchart. Structured Programming Design. Implementation Documentation.
Microsoft Visual Basic 2012: Reloaded Fifth Edition Chapter One An Introduction to Visual Basic 2012.
Chapter 1: Introduction to Computers and Programming.
Software Engineering Algorithms, Compilers, & Lifecycle.
PROGRAMMING (1) LECTURE # 1 Programming and Languages: Telling the Computer What to Do.
Victoria Ibarra Mat:  Generally, Computer hardware is divided into four main functional areas. These are:  Input devices Input devices  Output.
Unit 11 Programming.
Chapter 12 Computer Programming.
CSCI-235 Micro-Computer Applications
Computer Programming.
Chapter 12: Computer Programming
Chapter 2- Visual Basic Schneider
Presentation transcript:

Chapter 12: Computer Programming 1 Computer Programming Chapter 12

Chapter 12: Computer Programming 2 Programming Basics Computer Programming and Software Engineering Programming Languages and Paradigms Program Planning Program Coding Program Testing and Documentation Programming Tools

Chapter 12: Computer Programming 3 Computer Programming and Software Engineering The instructions that make up a computer program are sometimes referred to as code Programs can have millions of lines of code

Chapter 12: Computer Programming 4 Computer Programming and Software Engineering

Chapter 12: Computer Programming 5 Programming Languages and Paradigms Programming languages are made up of keywords and grammar rules designed for creating computer instructions Low-level languages High-level languages

Chapter 12: Computer Programming 6 Programming Languages and Paradigms First-generation languages Second-generation languages Third-generation languages

Chapter 12: Computer Programming 7 Programming Languages and Paradigms Fourth-generation languages Fifth-generation languages The Programming Paradigm

Chapter 12: Computer Programming 8 Programming Languages and Paradigms

Chapter 12: Computer Programming 9 Program Planning The problem statement defines certain elements that must be manipulated to achieve a result or goal You accept assumptions as true to proceed with program planning Known information helps the computer to solve a problem Variables vs. constants

Chapter 12: Computer Programming 10 Program Planning Problem statement: Assuming that there are two pizzas to compare, that both pizzas contain the same toppings, and that the pizzas could be round or square, and given the prices, shapes, and sizes of the two pizzas, the computer will print a message indicating which pizza has the lower price per square inch

Chapter 12: Computer Programming 11 Program Coding A text editor such as Notepad allows programmers to enter lines of code using a familiar word processing interface.

Chapter 12: Computer Programming 12 Program Coding VDE (visual development environment) –Form design grid –Control –Properties –Event –Event- handling code

Chapter 12: Computer Programming 13 Program Coding Controls, such as the Best Deal button, can be selected by a programmer from a properties list. Here a programmer is selecting the background color for the Best Deal button.

Chapter 12: Computer Programming 14 Program Coding

Chapter 12: Computer Programming 15 Program Testing and Documentation A computer program must be tested Program errors include –Syntax errors –Runtime errors –Logic errors Debugger

Chapter 12: Computer Programming 16 Program Testing and Documentation Remarks/Comments

Chapter 12: Computer Programming 17 Programming Tools SDK (software development kit) IDE (integrated development environment)

Chapter 12: Computer Programming 18 Programming Tools Component API C and C++ are the most popular programming languages

Chapter 12: Computer Programming 19 Procedural Programming Algorithms Expressing an Algorithm Sequence, Selection, and Repetition Controls Procedural Languages and Applications

Chapter 12: Computer Programming 20 Algorithms What is an algorithm? Record steps to solve the problem Specify how to manipulate information Specify a solution

Chapter 12: Computer Programming 21 Algorithms

Chapter 12: Computer Programming 22 Expressing an Algorithm Pseudocode

Chapter 12: Computer Programming 23 Expressing an Algorithm Flowchart The pizza program flowchart illustrates how the computer should proceed through the instructions in the final program.

Chapter 12: Computer Programming 24 Expressing an Algorithm Perform a walkthrough to make sure your algorithm works

Chapter 12: Computer Programming 25 Sequence, Selection, and Repetition Controls Sequence control structure Executing a GOTO command directs the computer to a different part of the program.

Chapter 12: Computer Programming 26 Sequence, Selection, and Repetition Controls Subroutines, procedures, and functions

Chapter 12: Computer Programming 27 Sequence, Selection, and Repetition Controls Selection control structure The computer executes a decision indicated on the flowchart by the question in the diamond shape.

Chapter 12: Computer Programming 28 Sequence, Selection, and Repetition Controls Repetition control structure To execute a loop, the computer repeats one or more commands until some condition indicates that the looping should stop.

Chapter 12: Computer Programming 29 Procedural Languages and Applications Popular procedural languages include FORTRAN, COBOL, FORTH, APL, ALGOL, PL/1, Pascal, C, Ada, and BASIC The procedural approach is best used for problems that can be solved by following a step-by-step algorithm Produces programs that run quickly and efficiently

Chapter 12: Computer Programming 30 Object-Oriented Programming Objects and Classes Inheritance Methods and Messages Object-oriented Program Structure Object-oriented Languages and Applications

Chapter 12: Computer Programming 31 Objects and Classes Object Class

Chapter 12: Computer Programming 32 Inheritance What is inheritance? –Superclass –Subclass –Class hierarchy

Chapter 12: Computer Programming 33 Methods and Messages Method –Collect input, perform calculations, etc. –A method is activated by a message –Can be defined along with the class they affect Polymorphism

Chapter 12: Computer Programming 34 Object-Oriented Program Structure

Chapter 12: Computer Programming 35 Object-Oriented Program Structure

Chapter 12: Computer Programming 36 Object-Oriented Program Structure When the pizza program runs, on-screen prompts ask for the shape, size, and price of each pizza; then the program displays a message that indicates which pizza is the best deal.

Chapter 12: Computer Programming 37 Object-Oriented Languages and Applications SIMULA was believed to be the first object- oriented computer language The Dynabook project was the second major development in object-oriented languages Popular object-oriented languages today are Ada95, C++, Visual Basic, C#, and Java The O-O paradigm results in decreased runtime efficiency, but allows encapsulation, which hides the internal details of objects and their methods

Chapter 12: Computer Programming 38 Declarative Programming The Declarative Paradigm Prolog Facts Prolog Rules Input Capabilities Declarative Languages and Applications

Chapter 12: Computer Programming 39 The Declarative Paradigm Attempts to describe a problem without specifying exactly how to arrive at a solution

Chapter 12: Computer Programming 40 Secure Programming Black Hat Exploits Secure Software Development Mitigation

Chapter 12: Computer Programming 41 Black Hat Exploits Today’s operating systems, utilities, and application software are full of defects that create security holes, which are exploited by black hats Buffer overflow

Chapter 12: Computer Programming 42 Black Hat Exploits

Chapter 12: Computer Programming 43 Black Hat Exploits Verbose error messages can also present attackers with information about the directory location of programs or files, the structure of a database, or the layout of the program in memory

Chapter 12: Computer Programming 44 Secure Software Development Most software security problems can be traced back to defects that programmers unintentionally introduce in software during design and development Formal methods help programmers apply rigorous logical and mathematical models to software design, coding, testing, and verification Threat modeling (risk analysis) – used by security designer to determine (1) what are important issues the designer cares about and (2) a description of a set of security aspects (possible attacks to consider)

Chapter 12: Computer Programming 45 Secure Software Development

Chapter 12: Computer Programming 46 Secure Software Development An attack tree is a hierarchical diagram of potential attacks against a system

Chapter 12: Computer Programming 47 Secure Software Development Defensive programming (AKA secure programming) –Source code walkthroughs –Simplification –Filtering input

Chapter 12: Computer Programming 48 Secure Software Development Signed code

Chapter 12: Computer Programming 49 Mitigation Despite defensive programming and other tactics to produce secure software, some defects inevitably remain undiscovered in products that end up in the consumers’ hands. When bugs are discovered, the programmer’s remaining line of defense is to produce a bug fix, or patch

Chapter 12: Computer Programming 50 Mitigation Take the following steps to avoid security problems that stem from software defects –Select applications from software publishers with a good security track record –Watch for patches and apply them –Consider using open source software, which has been extensively reviewed by the programming community –Keep your firewall and antivirus software deployed and up-to-date

Chapter 12: Computer Programming 51 Chapter 12 Complete Computer Programming