Computer Programming.

Slides:



Advertisements
Similar presentations
Copyright © 2003 by Prentice Hall Computers: Tools for an Information Age Chapter 15 Programming and Languages: Telling the Computer What to Do.
Advertisements

Introduction to Programming in C++ John Galletly.
CHAPTER 2 GC101 Program’s algorithm 1. COMMUNICATING WITH A COMPUTER  Programming languages bridge the gap between human thought processes and computer.
Chapter 8 High-Level Programming Languages. 8-2 Chapter Goals Describe the translation process and distinguish between assembly, compilation, interpretation,
Chapter 12 Computer Programming
Chapter 12 Computer Programming.
Computers Are Your Future
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Computers: Tools for an Information Age
Computer Programming.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Chapter 3 Planning Your Solution
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
1 Chapter One A First Program Using C#. 2 Objectives Learn about programming tasks Learn object-oriented programming concepts Learn about the C# programming.
1 Technology in Action Chapter 7 Behind the Scenes: Software Programming.
Programming Languages: Telling the Computers What to Do Chapter 16.
A First Program Using C#
GENERAL CONCEPTS OF OOPS INTRODUCTION With rapidly changing world and highly competitive and versatile nature of industry, the operations are becoming.
信息处理技术.
COMPUTER PROGRAMMING Source: Computing Concepts (the I-series) by Haag, Cummings, and Rhea, McGraw-Hill/Irwin, 2002.
Evolution of Programming Languages Generations of PLs.
COMPUTER PROGRAMS AND LANGUAGES Chapter 4. Developing a computer program Programs are a set (series) of instructions Programmers determine The instructions.
1 Introduction Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Sections
Computer Concepts 2014 Chapter 12 Computer Programming.
© 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.
Copyright © Prentice Hall Programming and Languages Chapter 14 Telling the Computer What to Do.
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.
Computer Concepts 2014 Chapter 12 Computer Programming.
Unit 11 Programming.
The Software Development Process
Computer Concepts 2013 Chapter 12 Computer Programming.
Chapter 12: Computer Programming 1 Computer Programming Chapter 12.
1 The Software Development Process ► Systems analysis ► Systems design ► Implementation ► Testing ► Documentation ► Evaluation ► Maintenance.
Software Design and Development Languages and Environments Computing Science.
Microsoft Visual Basic 2012: Reloaded Fifth Edition Chapter One An Introduction to Visual Basic 2012.
PROGRAMMING (1) LECTURE # 1 Programming and Languages: Telling the Computer What to Do.
IS 350 Course Introduction. Slide 2 Objectives Identify the steps performed in the software development life cycle Describe selected tools used to design.
Computer Concepts 2016 Unit E Step-by-Step: Programming with Python ENHANCED EDITION.
Principles of Programming & Software Engineering
Unit 11 Programming.
Chapter 12 Computer Programming.
Programming paradigms
High and low level languages
CSCI-235 Micro-Computer Applications
Computer Programming.
Key Ideas from day 1 slides
Chapter 2- Visual Basic Schneider
Microsoft Access Illustrated
An Introduction to Visual Basic .NET and Program Design
Unit E Step-by-Step: Programming with Python
Problem Solving Techniques
Chapter 12: Computer Programming
Chapter 2- Visual Basic Schneider
Chapter 1 Introduction(1.1)
Chapter 2- Visual Basic Schneider
Chapter One: An Introduction to Programming and Visual Basic
Algorithm and Ambiguity
and Program Development
강의 내용 및 방법 접근방법 리포트 시험 Lambda Calculus, Proof of Correctness
Tonga Institute of Higher Education IT 141: Information Systems
Tonga Institute of Higher Education IT 141: Information Systems
Basic Concepts of Algorithm
Presentation transcript:

Computer Programming

Chapter Contents Section A: Programming Basics Section B: Procedural Programming Section C: Object-Oriented Programming Section D: Declarative Programming 11/12/2018

Section A: Programming Basics Computer Programming and Software Engineering Programming Languages and Paradigms Program Planning Program Coding Program Testing and Documentation 11/12/2018

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 Developed by computer programmers Computer programming 11/12/2018

Computer Programming and Software Engineering 11/12/2018

Programming Languages and Paradigms Programming languages are made up of keywords and grammar rules designed for creating computer instructions Keywords can be combined with parameters Low-level languages typically include commands specific to a particular CPU or microprocessor family High-level languages use command words and grammar based on human languages 11/12/2018

Programming Languages and Paradigms First-generation languages Machine language Second-generation languages Assembly language Third-generation languages Easy-to-remember command words 11/12/2018

Programming Languages and Paradigms Fourth-generation languages More closely resembles human language Fifth-generation languages Based on a declarative programming paradigm The programming paradigm refers to a way of conceptualizing and structuring the tasks a computer performs 11/12/2018

Programming Languages and Paradigms 11/12/2018

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 11/12/2018

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 11/12/2018

Program Coding A text editor such as Notepad allows programmers to enter lines of code using a familiar word processing interface. CLICK TO START 11/12/2018

Program Coding A program editor is a type of text editor specially designed for entering code for computer programs 11/12/2018

Program Coding A VDE (visual development environment) provides programmers with tools to build substantial sections of a program Form design grid Control Properties Event Event-handling code 11/12/2018

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. CLICK TO START 11/12/2018

Program Coding 11/12/2018

Program Testing and Documentation A computer program must be tested to ensure that it works correctly Program errors include Syntax errors Runtime errors Logic errors A debugger can help a programmer read through lines of code and solve problems 11/12/2018

Program Testing and Documentation Remarks or “comments” are a form of documentation that programmers insert into the program code 11/12/2018

Section B: Procedural Programming Algorithms Expressing an Algorithm Sequence, Selection, and Repetition Controls Procedural Languages and Applications 11/12/2018

Algorithms Set of steps for carrying out a task that can be written down and implemented Start by recording the steps you take to solve the problem manually Specify how to manipulate information Specify what the algorithm should display as a solution 11/12/2018

Algorithms 11/12/2018

Expressing an Algorithm Structured English Pseudocode 11/12/2018

Expressing an Algorithm Flowchart The pizza program flowchart illustrates how the computer should proceed through the instructions in the final program. CLICK TO START 11/12/2018

Expressing an Algorithm Perform a walkthrough to make sure your algorithm works 11/12/2018

Sequence, Selection, and Repetition Controls Sequence control structure Executing a GOTO command directs the computer to a different part of the program. CLICK TO START 11/12/2018

Sequence, Selection, and Repetition Controls Subroutines, procedures, and functions are sections of code that are part of the program, but not included in the main execution path 11/12/2018

Sequence, Selection, and Repetition Controls Selection control structure The computer executes a decision indicated on the flowchart by the question in the diamond shape. CLICK TO START 11/12/2018

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. CLICK TO START 11/12/2018

Procedural Languages and Applications Popular procedural languages include FORTRAN, COBOL, FORTH, APL, Pascal, C, and BASIC The procedural approach is best used for problems that can be solved by following a step-by-step algorithm Does not fit well with certain types of problems Produces programs that run quickly and efficiently 11/12/2018

Section C: Object-Oriented Programming Objects and Classes Inheritance Methods and Messages Object-oriented Program Structure Object-oriented Languages and Applications 11/12/2018

Objects and Classes An object represents an abstract or real-world entity A class is a template for a group of objects with similar characteristics A class attribute defines the characteristics of a set of objects Public vs. private attributes 11/12/2018

Inheritance Passing certain characteristics from one class to other classes Class hierarchy 11/12/2018

Methods and Messages A method is a segment of code that defines an action Collect input, perform calculations, etc. A method is activated by a message Can be defined along with the class they affect Polymorphism refers to the ability to redefine a method in a subclass Helps simplify program code 11/12/2018

Object-Oriented Program Structure 11/12/2018

Object-Oriented Program Structure 11/12/2018

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. CLICK TO START 11/12/2018

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 C, C++, Visual Basic, and C# The OO paradigm results in decreased runtime efficiency, but allows encapsulation, which hides the internal details of objects and their methods 11/12/2018

Section D: Declarative Programming The Declarative Paradigm Prolog Facts Prolog Rules Input Capabilities Debugging with Trace Declarative Languages and Applications 11/12/2018

The Declarative Paradigm Attempts to describe a problem without specifying exactly how to arrive at a solution A fact is a statement for solving a problem Rules describe the relationship between facts 11/12/2018

The Declarative Paradigm A decision table is a tabular method for visualizing and specifying rules beased on multiple factors 11/12/2018

Prolog Facts 11/12/2018

Prolog Facts You can query a program’s database by asking a question, called a goal The ?- prompt allows you to query a set of Prolog facts and rules. CLICK TO START 11/12/2018

Prolog Facts Finding a value for a variable is referred to as instantiation Prolog uses a process called instantiation to satisfy goals. CLICK TO START 11/12/2018

Prolog Facts Backtracking refers to a process by which every possible solution is tried 11/12/2018

Prolog Rules The order of program instructions is critically important 11/12/2018

Input Capabilities CLICK TO START 11/12/2018

Debugging with Trace The trace feature allows you to track through each instantiation 11/12/2018

Declarative Languages and Applications Declarative programming languages are most suitable for problems that pertain to words and concepts rather than to numbers High effective programming environment Not commonly used for production applications Minimal input and output capabilities Poor performance on today’s personal computer architecture 11/12/2018