Programming Languages: Telling the Computers What to Do Chapter 16.

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

Welcome to CMPE003 Personal Computers: Hardware and Software Dr. Chane Fullmer Fall 2002 UC Santa Cruz.
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.
1 Program Flow Charting How to tackle the beginning stage a program design.
1 Lecture 1  Getting ready to program  Hardware Model  Software Model  Programming Languages  The C Language  Software Engineering  Programming.
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.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
1414 CHAPTER PROGRAMMING AND LANGUAGES. © 2005 The McGraw-Hill Companies, Inc. All Rights Reserved Competencies Describe the six steps of programming.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
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.
Programming In C++ Spring Semester 2013 Programming In C++, Lecture 1.
CS102 Introduction to Computer Programming
© Paradigm Publishing Inc Chapter 12 Programming Concepts and Languages.
Chapter 13 Programming Languages and Program Development 1.
Java Programming, 2E Introductory Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.
Computers Are Your Future Tenth Edition Chapter 11: Programming Languages & Program Development Copyright © 2009 Pearson Education, Inc. Publishing as.
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.
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.
CHAPTER 1 Overview of Programming and Problem Solving.
CHAPTER ONE Problem Solving and the Object- Oriented Paradigm.
Evolution of Programming Languages Generations of PLs.
PROGRAMMING LANGUAGES Prof. Lani Cantonjos. PROGRAM - set of step-by-step instructions that tells or directs the computer what to do. PROGRAMMING LANGUAGE.
Chapter 15 Program Development and Programming Languages.
CMPE13Cyrus Bazeghi 1 Programming Languages Telling computers what to do.
Computer Concepts 2014 Chapter 12 Computer Programming.
Java Programming, Second Edition Chapter One Creating Your First Java Program.
1 Chapter 13 Understanding Computers, 11 th Edition 13 Program Development and Programming Languages TODAY AND TOMORROW 11 th Edition CHAPTER.
Discovering Computers 2009 Chapter 13 Programming Languages and Program Development.
Computer Programs and Programming Languages What are low-level languages and high-level languages? High-level language Low-level language Machine-dependent.
CSC425 - Introduction To Computer Programming 1. 2 Generation Of Programming Languages A set of rules that telling a computer what to do. There are over.
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.
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.
The Programming Process Define the problem* Make or buy software? Design the program * Code (write) the program Test (debug) the program Document the.
Module 4 Part 2 Introduction To Software Development : Programming & Languages Introduction To Software Development : Programming & Languages.
Software Development Programming & Languages. Programming: A Five-Step Procedure Define the problem Design a solution Code the program Test the program.
Chapter One An Introduction to Programming and Visual Basic.
Chapter 4 Software. Chapter 4: Software Generations of Languages Each computer is wired to perform certain operations in response to an instruction. An.
CSC1200 INTRODUCTION TO PROGRAMMING Dr. Maureen Markel
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.
Chapter 11  Getting ready to program  Hardware Model  Software Model  Programming Languages  Facts about C++  Program Development Process  The Hello-world.
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.
Your Interactive Guide to the Digital World Discovering Computers 2012 Chapter 13 Computer Programs and Programming Languages.
CSCI-235 Micro-Computer Applications
Computer Programming.
Programming Concepts and Languages
Computer Programming.
Chapter 12 Programming Concepts and Languages.
Chapter 1 Introduction(1.1)
The Programming Process
Presentation transcript:

Programming Languages: Telling the Computers What to Do Chapter 16

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 in use today Explain the concepts of object-oriented programming

Contents Program Programmers The Programming Process Choosing a Language Traditional Programming Object-Oriented Programming Learning to Program

Program Set of instructions written in a programming language that tells the computer what to do

Programmers Prepare instructions that make up the program Run the instructions to see if they produce the correct results Make corrections Document the program Interact with –Users –Managers –Systems analysts Coordinate with other programmers to build a complete system

The Programming Process Defining the problem Planning the solution Coding the program Testing the program Documenting the program

The Programming Process Defining the Problem What is the input What output do you expect How do you get from the input to the output

The Programming Process Planning the Solution Algorithm – detailed solution to a problem Design tools –Flowchart –Pseudocode Desk-checking Structured walkthrough

The Programming Process Planning the Solution Accept series of numbers and display the average

The Programming Process Planning the Solution Accept series of numbers and display the average

The Programming Process Coding the Program Translate algorithm into a formal programming language Syntax How to key in the statements? –Text editor –Programming environment – Interactive Development Environment (IDE)

The Programming Process Testing the Program Translation – compiler –Translates from source module into object module –Detects syntax errors Link – linkage editor (linker) –Combines object module with libraries to create load module –Finds undefined external references Debugging –Run using data that tests all statements –Logic errors

The Programming Process Testing the Program

The Programming Process Documenting the Program Performed throughout the development Material generated during each step –Problem definitions –Program plan –Comments within source code –Testing procedures –Narrative –Layouts of input and output –Program listing

Choosing a Language Choice made for you –What is available? –Required interface What do you know best? Which language lends itself to the problem to be solved?

Language Generations Low levels closer to binary High levels closer to human code Five Generations: –Procedural Languages Machine language Assembly language High-level language – 3GL –Nonprocedural Languages Very high-level language – 4GL Natural language – 5GL

Machine Language Written in strings of 0 and 1 Only language the computer understands All other programming languages are translated to machine language Computer dependent

Assembly Language Mnemonic codes Names for memory locations Computer dependent Assembler translates from Assembly to machine language

3GL High-Level Languages 1960s Languages designed for specific types of problems and used syntax familiar to the people in that field –FORTRAN: math –COBOL: business Compile translates from high-level language to machine language

4GL Very High-Level Languages Programmer specifies the desired results; the language develops the solution Ten times more productive with a 4GL than a procedural language Query Languages –Retrieve information from databases –Easy to learn and use

5GL Natural Languages Resemble natural or spoken English Translates human instructions into code the computer can execute Commonly used by non-programmers to access databases

Third Generation Languages Traditional Programming Describe data Describe procedures or operations on that data Data and procedures are separate

Third Generation Languages FORTRAN –1954 –Represent complex mathematical formulas –C/C++ has replaced FORTRAN COBOL –1959 –Business –Large complex data files –Formatted business reports

Third Generation Languages FORTRAN

Third Generation Languages COBOL

Third Generation Languages BASIC –1965 –Popularity grew with PC popularity (1970s) –Easy to learn –Used little memory RPG –1965 –Report generation – quickly creates complex reports

Third Generation Languages BASIC

Third Generation Languages Visual Basic –1987 –Create complex user interfaces –Uses standard Windows features –Event-driven – user controls the program C –1972 –Efficient code –Portability C++ –Enhancement of C

Third Generation Languages C++

OOP Object-Oriented Programming Object –Self-contained unit of data and instructions –Includes Related facts (data) Related functions (instructions to act on that data) Example –Object:cat –Data:feet, nose, fur, tail –Functions:eat, purr, scratch, walk –Cat:Kitty, Susan

OOP Object-Oriented Programming Encapsulation – describes the objects self- containment Attributes – the facts that describe the object Methods / operations – the instructions that tell the object what to do Instance – one occurrence of an object Messages – activate methods Example: A walk message causes Kitty to move

OOP Object-Oriented Programming Class – defines characteristics unique to all objects of that class Inheritance – Objects of a class automatically posses all of the characteristics of the class from which it was derived Subclass – inherits characteristics from class and defines additional characteristics that are unique

OOP Object-Oriented Programming Example Class: Animal Subclass: Cat Subclass: Persian cat Instance: Kitty Objects can be reused

OOP Object-Oriented Programming Languages C++ Can write both structured and object-oriented code Visual Basic Rudimentary features of object-oriented language

Third Generation Languages Java Cross-platform Java Virtual Machine (JVM) –Sits on top of computer’s regular platform –Translates compiled Java code into instructions for the specific platform Applets

OOP Object-Oriented Programming Using Objects in Business Class:Customer Subclass:Retail or Wholesale Instance: John Smith Retail and Wholesale customers automatically inherit customer address since it is part of the Customer class

Learning to Program Enroll in courses Read Use tutorials View Sample code Write code (start small) Use Help