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

Slides:



Advertisements
Similar presentations
Introduction to Computer Programming
Advertisements

© 2005 by Prentice Hall Chapter 13 Finalizing Design Specifications Modern Systems Analysis and Design Fourth Edition Jeffrey A. Hoffer Joey F. George.
Excel Functions. Part 1. Introduction 2 An Excel function is a formula or a procedure that is performed in the Visual Basic environment, outside the.
Configuration management
Chapter 1 Introduction to Visual Basic Programming and Applications 1 Exploring Microsoft Visual Basic 6.0 Copyright © 1999 Prentice-Hall, Inc. By Carlotta.
Chapter 10: The Traditional Approach to Design
Systems Analysis and Design in a Changing World, Fifth Edition
Chapter 9 Interactive Multimedia Authoring with Flash Introduction to Programming 1.
Chapter 12 Programming Concepts and Languages
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 13 Slide 1 Application architectures.
Languages for IT & CS Pseudo-code What HTML isn’t Early history Compiling & interpreting Classifying languages The process of programming.
CHAPTER 2 GC101 Program’s algorithm 1. COMMUNICATING WITH A COMPUTER  Programming languages bridge the gap between human thought processes and computer.
Copyright © 2002 W. A. Tucker1 Chapter 1 Lecture Notes Bill Tucker Austin Community College COSC 1315.
Computers Are Your Future
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Welcome to CMPE003 Personal Computer Concepts: Hardware and Software Winter 2003 UC Santa Cruz Instructor: Guy Cox.
Module 10 Programming ___tell computers what to do
Programming Creating programs that run on your PC
Computers Are Your Future © 2006 Prentice Hall, Inc.
Computers: Tools for an Information Age
Program Flow Charting How to tackle the beginning stage a program design.
Program Flow Charting How to tackle the beginning stage a program design.
Java Programming, 3e Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.
Chapter 16 Programming and Languages: Telling the Computer What to Do.
© Prentice Hall CHAPTER 3 Computer Software.
Starting Out with C++: Early Objects 5/e © 2006 Pearson Education. All Rights Reserved Starting Out with C++: Early Objects 5 th Edition Chapter 1 Introduction.
1414 CHAPTER PROGRAMMING AND LANGUAGES. © 2005 The McGraw-Hill Companies, Inc. All Rights Reserved Competencies Describe the six steps of programming.
Programming Concepts and Languages Chapter 12 – Computers: Understanding Technology, 3 rd edition 1November
Copyright © 2001 by Wiley. All rights reserved. Chapter 1: Introduction to Programming and Visual Basic Computer Operations What is Programming? OOED Programming.
Lesson 4 Computer Software
CS102 Introduction to Computer Programming
DCT 1123 PROBLEM SOLVING & ALGORITHMS INTRODUCTION TO PROGRAMMING.
Java Programming, 2E Introductory Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.
CSC 125 Introduction to C++ Programming Chapter 1 Introduction to Computers and Programming.
Computers Are Your Future Tenth Edition Chapter 11: Programming Languages & Program Development Copyright © 2009 Pearson Education, Inc. Publishing as.
Program development & programming languages Chapter 13.
Programming Languages: Telling the Computers What to Do Chapter 16.
Chapter 1: Introduction to Visual Basic.NET: Background and Perspective Visual Basic.NET Programming: From Problem Analysis to Program Design.
© Janice Regan, CMPT 128, Jan CMPT 128 Introduction to Computing Science for Engineering Students Creating a program.
COMPUTER SOFTWARE Section 2 “System Software: Computer System Management ” CHAPTER 4 Lecture-6/ T. Nouf Almujally 1.
Learning Objectives Data and Information Six Basic Operations Computer Operations Programs and Programming What is Programming? Types of Languages Levels.
UNIVERSITI TENAGA NASIONAL “Generates Professionals” CHAPTER 4 : Part 2 INTRODUCTION TO SOFTWARE DEVELOPMENT: PROGRAMMING & LANGUAGES.
COMPUTER PROGRAMMING Source: Computing Concepts (the I-series) by Haag, Cummings, and Rhea, McGraw-Hill/Irwin, 2002.
PROGRAMMING LANGUAGES Prof. Lani Cantonjos. PROGRAM - set of step-by-step instructions that tells or directs the computer what to do. PROGRAMMING LANGUAGE.
CMPE13Cyrus Bazeghi 1 Programming Languages Telling computers what to do.
Computer Concepts 2014 Chapter 12 Computer Programming.
Lead Black Slide. © 2001 Business & Information Systems 2/e2 Chapter 5 Information System Software.
Lecture 1 Introduction Figures from Lewis, “C# Software Solutions”, Addison Wesley Richard Gesick.
INTRODUCTION TO COMPUTING CHAPTER NO. 04. Programming Languages Program Algorithms and Pseudo Code Properties and Advantages of Algorithms Flowchart (Symbols.
Copyright © Prentice Hall Programming and Languages Chapter 14 Telling the Computer What to Do.
McGraw-Hill/Irwin Copyright © 2013 by The McGraw-Hill Companies, Inc. All rights reserved. Chapter 4 Computer Software.
Module 4 Part 2 Introduction To Software Development : Programming & Languages Introduction To Software Development : Programming & Languages.
10/8: Software What is software? –Types of software System software: Operating systems Applications Creating software –Evolution of software development.
Chapter One An Introduction to Programming and Visual Basic.
Chapter 14 Programming and Languages McGraw-Hill/Irwin Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved.
Chapter 1: Introduction to Visual Basic.NET: Background and Perspective Visual Basic.NET Programming: From Problem Analysis to Program Design.
Lecture #1: Introduction to Algorithms and Problem Solving Dr. Hmood Al-Dossari King Saud University Department of Computer Science 6 February 2012.
PROGRAMMING FUNDAMENTALS INTRODUCTION TO PROGRAMMING. Computer Programming Concepts. Flowchart. Structured Programming Design. Implementation Documentation.
Introduction to Programming Languages © 2005 Prentice Hall, Inc. CXC IT Unit 2: Intro. to Programming.
Chapter 1: Introduction to Computers and Programming.
PROGRAMMING (1) LECTURE # 1 Programming and Languages: Telling the Computer What to Do.
Lecture 1 Introduction Richard Gesick.
CSCI-235 Micro-Computer Applications
Computer Programming.
Programming Concepts and Languages
Chapter 4 Computer Software.
An Introduction to Visual Basic .NET and Program Design
Computer Programming.
Chapter 1 Introduction(1.1)
Chapter One: An Introduction to Programming and Visual Basic
Presentation transcript:

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

2Copyright © 2003 by Prentice Hall Objectives Describe what programmers do and do not do Explain how programmers define a problem, plan the solution, and then code, test, and document the program List and describe the levels of programming languages: machine, assembly, high level, very high level, and natural Describe the major programming languages that are in use today Explain the concepts of object-oriented programming

3Copyright © 2003 by Prentice Hall Programming Program – a set of detailed, step-by-step instructions that directs the computer to do what you want it to do Programming language – a set of rules that provides a way of telling the computer what operations to perform

4Copyright © 2003 by Prentice Hall The Programming Process Five main steps Defining the problem Defining the problem Defining the problem Defining the problem Planning the solution Planning the solution Planning the solution Planning the solution Coding the program Coding the program Coding the program Coding the program Testing the program Testing the program Testing the program Testing the program Documenting the program Documenting the program Documenting the program Documenting the program

5Copyright © 2003 by Prentice Hall Defining the Problem Develop a written agreement that specifies: The input data The input data The desired output The desired output The processing required to convert The processing required to convert Sometimes, the programmer receives a written specification from the systems analyst Other times, the programmer meets with users directly Other times, the programmer meets with users directly Return

6Copyright © 2003 by Prentice Hall Planning the Solution Algorithm – a detailed, step-by-step solution to the problem Several tools help plan the algorithm plan the algorithmplan the algorithm Desk-check the solution Carry out each step of the algorithm with pencil and paper Carry out each step of the algorithm with pencil and paper Return

7Copyright © 2003 by Prentice Hall Planning Tools Flowchart – a pictorial representation of the algorithm Flowchart – a pictorial representation of the algorithm Pseudocode – English-like language Pseudocode – English-like language Specifies algorithm with more precision than you can in English, but less than a programming language Return

8Copyright © 2003 by Prentice Hall Coding the Program Translating the algorithm from the planning stage into a formal programming language All languages have syntax rules Similar to grammatical rules Similar to grammatical rules The computer will reject a program with even a minor syntax error The computer will reject a program with even a minor syntax error Programs can be keyed into the computer by using a text editor Return

9Copyright © 2003 by Prentice Hall Testing the Program Two phases of testing the program Translation Translation Translation Converting the program you wrote into the binary instructions the CPU understands Converting the program you wrote into the binary instructions the CPU understands Debugging Debugging Identifying and correcting logic errors in the program Identifying and correcting logic errors in the program Return

10Copyright © 2003 by Prentice Hall Translation Compiler translates the program (source module) into a machine language version (object module) If the compiler detects syntax errors, it will produce messages describing those errors If the compiler detects syntax errors, it will produce messages describing those errors If no syntax errors exist, the object module will be linked to create a load module If no syntax errors exist, the object module will be linked to create a load module Load module is executed by the computer Load module is executed by the computer Return

11Copyright © 2003 by Prentice Hall Documenting the Program Materials are generated at each part of the process Common examples of documentation Flowchart and/or pseudocode Flowchart and/or pseudocode Comments within the source code Comments within the source code Testing procedures Testing procedures Layouts of input and output records Layouts of input and output records A narrative description of the program A narrative description of the program Return

12Copyright © 2003 by Prentice Hall Levels of Languages Lower-level languages – more like the 0s and 1s the computer itself uses Higher-level languages – more like the languages people use Divided into five generations

13Copyright © 2003 by Prentice Hall Five Generations of Languages Machine language Machine language Assembly languages Assembly languages High-level languages High-level languages Very high-level languages Very high-level languages Natural languages Natural languages

14Copyright © 2003 by Prentice Hall Machine Language Programs and memory locations are written in strings of 0s and 1s Problems with machine languages Programs are difficult to write and debug Programs are difficult to write and debug Each computer has its own machine language Each computer has its own machine language Only option available to early programmers Return

15Copyright © 2003 by Prentice Hall Assembly Languages Substitute mnemonic codes for 0s and 1s For example, A for add, C for compare, etc. For example, A for add, C for compare, etc. Use names rather than binary addresses for memory locations Use names rather than binary addresses for memory locations Require an assembler to translate the program into machine language Still used for programming chips and writing utility programs Return

16Copyright © 2003 by Prentice Hall High-Level Languages Transformed programming Programmers could focus on solving problems rather than manipulating hardware Programmers could focus on solving problems rather than manipulating hardware Programs could be written and debugged much more quickly Programs could be written and debugged much more quickly Requires a compiler to convert the statements into machine language Each computer has its own version of a compiler for each language Each computer has its own version of a compiler for each language Return

17Copyright © 2003 by Prentice Hall Very High-Level Languages Also called fourth-generation languages (4GLs) Considered nonprocedural languages The programmer specifies the desired results, and the language develops the solution The programmer specifies the desired results, and the language develops the solution Programmers can be about 10 times more productive using a fourth-generation language than a third-generation language Programmers can be about 10 times more productive using a fourth-generation language than a third-generation language Return

18Copyright © 2003 by Prentice Hall Natural Languages Resemble written or spoken English Programs can be written in a natural syntax, rather than in the syntax rules of a programming language Programs can be written in a natural syntax, rather than in the syntax rules of a programming language The language translates the instructions into code the computer can execute Return

19Copyright © 2003 by Prentice Hall Major Programming Languages FORTRAN COBOL BASIC RPG Visual Basic Visual Basic C Java

20Copyright © 2003 by Prentice Hall FORTRAN The first high-level language Stands for FORmula TRANslator Used primarily for engineering, mathematical, and scientific tasks Return

21Copyright © 2003 by Prentice Hall COBOL Stands for COmmon Business-Oriented Language Used primarily for business requirements Processes large data files Processes large data files Produces well-formatted reports Produces well-formatted reports Return

22Copyright © 2003 by Prentice Hall BASIC Stands for Beginners’ All- Purpose Symbolic Instruction Code Developed to teach programming to college students Became very popular with the introduction of the microcomputer Return

23Copyright © 2003 by Prentice Hall RPG Stands for Report Program Generator Designed to allow rapid creation of reports Programmer simply describes the source data and desired report format Programmer simply describes the source data and desired report format Return

24Copyright © 2003 by Prentice Hall Visual Basic Allows programmer to create Windows-like user interfaces Programmer drags a control (button, text box, etc.) onto the form Programmer drags a control (button, text box, etc.) onto the form VB creates the code associated with that control VB creates the code associated with that control VB is event-driven The user controls the program The user controls the program Return

25Copyright © 2003 by Prentice Hall C Originally designed to write systems software Offers the ease of use of a high-level language with the efficiency of an assembly language Offers the ease of use of a high-level language with the efficiency of an assembly language Very portable – can be used with virtually every combination of computer and operating system Return

26Copyright © 2003 by Prentice Hall Java A network-friendly programming language that permits a piece of software to run directly on many different platforms Allows programmers to write one version of the program, rather than a separate version of each platform Allows programmers to write one version of the program, rather than a separate version of each platform Very useful for Internet development Java applets can run in the user’s Web browser Java applets can run in the user’s Web browser Return

27Copyright © 2003 by Prentice Hall Object-Oriented Programming Object – a self-contained unit that contains both data and its related functions Key terms in object-oriented programming Encapsulation – an object isolates both its data and its related instructions Encapsulation – an object isolates both its data and its related instructions Attributes – facts that describe the object Attributes – facts that describe the object Also called properties Methods – instructions that tell the object to do something Methods – instructions that tell the object to do something Messages – an outside stimulus that results in the change of the state of an object Messages – an outside stimulus that results in the change of the state of an object

28Copyright © 2003 by Prentice Hall Using Objects Programmers define classes of objects The class contains all attributes that are unique to objects of that class The class contains all attributes that are unique to objects of that class An object is an instance (occurrence) of a class An object is an instance (occurrence) of a class Objects are arranged hierarchically in classes and subclasses Subclasses are derived from classes Subclasses are derived from classes Inheritance – a subclass possesses all attributes of the class from which it is derived Inheritance – a subclass possesses all attributes of the class from which it is derived Additional attributes can be coded in the subclasses Additional attributes can be coded in the subclasses

29Copyright © 2003 by Prentice Hall Activating the Object A message is sent to the object, telling it to do something The object’s methods tell it how to do it The object’s methods tell it how to do it Polymorphism – each object has its own way to process the message For example, the class may have a Move method, but each subclass implements that method differently For example, the class may have a Move method, but each subclass implements that method differently

30Copyright © 2003 by Prentice Hall Object-Oriented Languages C++ Java C# Visual Basic Visual Basic

31Copyright © 2003 by Prentice Hall C++ An enhancement of the C language Includes all features of C Includes all features of C Adds support for object-oriented programming Adds support for object-oriented programming Can be used as simply an improvement of C, without the object-oriented features Return

32Copyright © 2003 by Prentice Hall Java A pure object-oriented program Used to create small programs called applets Applets can be delivered over the Web and run on any platform Applets can be delivered over the Web and run on any platform Return

33Copyright © 2003 by Prentice Hall C# Microsoft’s answer to Java Has the same advantages over C++ that Java has Designed to work within Microsoft’s.NET environment.NET is designed for building, deploying, and running Web-based applications.NET is designed for building, deploying, and running Web-based applications Return

34Copyright © 2003 by Prentice Hall Visual Basic Previous versions supported some object technology The current version, VB.NET, is the first to support inheritance and polymorphism These two traits are required for a true object- oriented language These two traits are required for a true object- oriented language Return