Copyright © Prentice Hall 20001 Programming and Languages Chapter 14 Telling the Computer What to Do.

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

CHAPTER 2 GC101 Program’s algorithm 1. COMMUNICATING WITH A COMPUTER  Programming languages bridge the gap between human thought processes and computer.
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Lecture 1: Overview of Computers & Programming
Computers Are Your Future
Chapter 1 - An Introduction to Computers and Problem Solving
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Conventional design Identifies functions and data structures as separate entities Identifies functions and data structures as separate entities Then Defines.
زبانهای برنامه سازی برنامه سازی پیشرفته ارائه دهنده دکتر سيد امين حسيني E.mail: Home page:
Welcome to CMPE003 Personal Computer Concepts: Hardware and Software Winter 2003 UC Santa Cruz Instructor: Guy Cox.
Programming Creating programs that run on your PC
Computer Concepts 5th Edition Parsons/Oja Page 546 CHAPTER 11 Software Engineering Section A PARSONS/OJA Computer Programming.
1 Program Flow Charting How to tackle the beginning stage a program design.
CIS105 Chapter 1 Theory Review. Page 2 Hardware and Software are the two major components o any computer system Hardware is the set of physical devices.
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.
Chapter 16 Programming and Languages: Telling the Computer What to Do.
© Prentice Hall CHAPTER 3 Computer Software.
Program Development and Programming Languages
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
PRE-PROGRAMMING PHASE
Copyright © 2001 by Wiley. All rights reserved. Chapter 1: Introduction to Programming and Visual Basic Computer Operations What is Programming? OOED Programming.
Copyright 2003 Scott/Jones Publishing Brief Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
Your Interactive Guide to the Digital World Discovering Computers 2012.
Program development & programming languages Chapter 13.
Programming Languages: Telling the Computers What to Do Chapter 16.
Programming Languages CPS120: Introduction to Computer Science Lecture 5.
Computers Are Your Future Eleventh Edition
CC111 Lec#5: Program Development 1 Program Development and Programming Languages Lecture 4 Reference :Understanding Computers Chapter 13.
สาขาวิชาเทคโนโลยี สารสนเทศ คณะเทคโนโลยีสารสนเทศ และการสื่อสาร.
Alexandria University Faculty of Science Computer Science Department Introduction to Programming (CS 102) C++ Programminhg.
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 1.07a.  A computer program is a series of instructions that direct a computer to perform a certain task.  A programming language.
PROGRAMMING LANGUAGES Prof. Lani Cantonjos. PROGRAM - set of step-by-step instructions that tells or directs the computer what to do. PROGRAMMING LANGUAGE.
TMF1013 : Introduction To Computing Lecture 1 : Fundamental of Computer ComputerFoudamentals.
CMPE13Cyrus Bazeghi 1 Programming Languages Telling computers what to do.
Introduction to Computers (L02) * Hardware * Software * Programming Languages * Three Phase of Program Development * Development and Design Steps * Algorithms.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 1- 1 October 20, October 20, 2015October 20, 2015October 20,
1 Chapter 13 Understanding Computers, 11 th Edition 13 Program Development and Programming Languages TODAY AND TOMORROW 11 th Edition CHAPTER.
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.
INTRODUCTION TO COMPUTING CHAPTER NO. 04. Programming Languages Program Algorithms and Pseudo Code Properties and Advantages of Algorithms Flowchart (Symbols.
Chapter 1 Introduction Chapter 1 Introduction 1 st Semester 2015 CSC 1101 Computer Programming-1.
Module 4 Part 2 Introduction To Software Development : Programming & Languages Introduction To Software Development : Programming & Languages.
CHAPTER 1 INTRODUCTION 1 st Semester H King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1.
CHAPTER 1 INTRODUCTION 1 st semester H King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1.
CHAPTER 1 INTRODUCTION 2 nd Semester H King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1.
Chapter One An Introduction to Programming and Visual Basic.
Chapter 1 Computers, Compilers, & Unix. Overview u Computer hardware u Unix u Computer Languages u Compilers.
Chapter 14 Programming and Languages McGraw-Hill/Irwin Copyright © 2008 by The McGraw-Hill Companies, Inc. All rights reserved.
LESSON 1 Introduction to Programming Language. Computer  Comprised of various devices that are referred to as HARDWARE.  The computer programs that.
Alexandria University Faculty of Science Computer Science Department Introduction to Programming C++
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.
How Computers Solve Problems Computers also use Algorithms to solve problems, and change data into information Computers can only perform one simple step.
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.
Programming Logic and Design Seventh Edition Chapter 1 An Overview of Computers and Programming.
CHAPTER 2 GC101 Program’s algorithm 1. COMMUNICATING WITH A COMPUTER  Programming languages bridge the gap between human thought processes and computer.
Chapter 1 Introduction 2nd Semester H
CSCI-235 Micro-Computer Applications
Computer Programming.
Computer Programming.
King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1 Done By: Asmal Alosaimi Edited By: Fatimah Alakeel.
King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1 Done By: Asmal Alosaimi Edited By: Fatimah Alakeel.
Programming Logic and Design Eighth Edition
Presentation transcript:

Copyright © Prentice Hall Programming and Languages Chapter 14 Telling the Computer What to Do

Copyright © Prentice Hall Programs A program is a set of step-by-step instructions that directs the computer to do the tasks you want it to do and produce the results you want.

Copyright © Prentice Hall Programming Languages A programming language is a set of rules that provides a way of telling a computer what operations to perform.

Copyright © Prentice Hall Programmers A programmer’s job is to convert problem solutions into instructions for the computer. If the project is large, they may also need to coordinate the needs of users, managers, and systems managers.

Copyright © Prentice Hall The Programming Process The steps involved in developing a program include: Define the problemDefine the problem Plan the solutionPlan the solution Code the programCode the program Test the programTest the program Document the programDocument the program

Copyright © Prentice Hall Define the Problem The task of defining the problem consists of identifying what it is you know and what it is you want to obtain.

Copyright © Prentice Hall Plan the Solution Planning the solution may involve drawing a flowchart or writing pseudocode, or both.

Copyright © Prentice Hall Flowcharts A flowchart is a pictorial representation of a step-by-step solution to a problem.

Copyright © Prentice Hall Flowchart Basics A flowchart consists of arrows to represent direction the program takes and boxes and symbols to represent actions.

Copyright © Prentice Hall Flowchart Symbols ProcessStart/Stop Input/Output Decision Connector Flow direction

Copyright © Prentice Hall Pseudocode Pseudocode is an English-like nonstandard language. It allows programmers to focus on the program logic without being concerned about the particulars of a formal programming language.

Copyright © Prentice Hall Code the Program Coding a program means to translate the logic from a flowchart of pseudocode into a programming language. The rules of computer languages are called syntax. These rules must be followed precisely.

Copyright © Prentice Hall Test the Program After coding, tests must be performed to make sure the steps are correct and render the desired results. Testing includes: Desk-checkingDesk-checking TranslatingTranslating DebuggingDebugging

Copyright © Prentice Hall Desk-checking This form of testing involves mentally checking the logic of the program to ensure that it is error-free and workable.

Copyright © Prentice Hall Translating Programs are commonly translated by a compiler which checks for syntax errors and converts the program into a form the computer understands.

Copyright © Prentice Hall Debugging Debugging means to detect, locate, and correct mistakes in the program. To find errors, you must test every part of the program under various conditions.

Copyright © Prentice Hall Document the Program A programmer must document the various stages the program has gone through as well as other specific facts about the program.

Copyright © Prentice Hall Levels of Programming Languages There are several levels (or “generations”) of programming languages: MachineMachine AssemblyAssembly High-levelHigh-level Very high-levelVery high-level NaturalNatural

Copyright © Prentice Hall First Generation: Machine Language This is the lowest level of programming language because it represents data and program instructions as 0s and 1s. All programming languages are eventually converted into machine language.

Copyright © Prentice Hall Second Generation: Assembly Language Assembly languages replace 0s and 1s with mnemonic codes. Since machine language is the only language the computer can execute, assembly is eventually translated into machine language to execute the program.

Copyright © Prentice Hall Third Generation: High-Level Language High-level languages use English-like words that are much easier for humans to understand. A translator is needed to convert the high-level language into machine language that computers understand.

Copyright © Prentice Hall Fourth Generation: Very High-Level Language This generation of language is often known as 4GLs. 4GLs are a shorthand programming language that is about 10 times more productive than third generation languages.

Copyright © Prentice Hall Fifth Generation: Natural Language This generation of programming languages more resembles “natural” spoken English. The user communicates with the computer by speaking.

Copyright © Prentice Hall Major Programming Languages There are several languages with which to write your program: FORTRAN FORTRAN COBOL COBOL BASIC BASIC Pascal Pascal C C Java Java Object-Oriented Object-Oriented

Copyright © Prentice Hall FORTRAN FORTRAN is a scientifically oriented language designed to execute complex formulas as in economic analysis and engineering.

Copyright © Prentice Hall COBOL COBOL was designed for business needs such as processing large files and performing business calculations.

Copyright © Prentice Hall BASIC This programming language is designed to be easy to learn. BASIC can be used for business applications and for use with personal computers.

Copyright © Prentice Hall Pascal Pascal was developed as a teaching language for computer students.

Copyright © Prentice Hall C C was originally developed to write systems software but is now considered a general-purpose language.

Copyright © Prentice Hall Java Java is a network- friendly programming language that permits a piece of software to run on many different platforms.

Copyright © Prentice Hall Object-Oriented Object-oriented programming is based on objects and their attributes.

Copyright © Prentice Hall Object Classes An object is a self-contained unit that contains both data and related facts and functions. Objects are arranged hierarchically in classes and subclasses based on their dominant characteristics.

Copyright © Prentice Hall Attributes and Methods Facts related to an object are called attributes. Methods are the instructions that tell the data what to do.

Copyright © Prentice Hall Object Inheritance An object in a subclass automatically possesses all the characteristics of the class from which it is derived.

Copyright © Prentice Hall Object-Oriented Languages There is an object-oriented version of C, called C++. Versions of C++ are available for large and personal computers. Smalltalk supports a visual system of programming. Text is entered with a keyboard but all other interaction takes place with mouse and icons.

Copyright © Prentice Hall Advantages of Object- Oriented Programming In a programming environment, a programmer does not have to repeat the instructions for “inherited” characteristics. This means a savings in time and money.

Copyright © Prentice Hall Sample Programs The following five slides demonstrate the syntax and structure of high- level programming languages. Only segments of an entire program are shown. Can you “guess” what each line in the program will do?

Copyright © Prentice Hall Fortran … WRITE (6,10) SUM=0 COUNTER = 0 WRITE (6,60) READ (5,40) NUMBER 1IF (NUMBER.EQ. 999) GOTO 2 SUM = SUM + NUMBER GOTO 1 …

Copyright © Prentice Hall COBOL …300-INITIALIZATION-ROUTINE. DISPLAY “PLEASE ENTER A NUMBER”. ACCEPT NUMBER-ITEM. 400-ENTER-AND-ADD. ADD NUMBER-ITEM TO SUM-ITEM. ADD 1 TO COUNTER. DISPLAY “PLEASE ENTER NEXT NUMBER” …

Copyright © Prentice Hall BASIC … SUM = 0 COUNTER = 0 PRINT “PLEASE ENTER A NUMBER” INPUT NUMBER DO WHILE NUMBER <> 999 SUM = SUM + NUMBER COUNTER = COUNTER + 1 …

Copyright © Prentice Hall Pascal …BEGIN sum :=0; counter :=0; WRITELN (‘PLEASE ENTER A NUMBER’); READLN (number); WHILE number <> 999 DO Begin (*while loop*) sum := sum + number; …

Copyright © Prentice Hall C++ … cout << “PLEASE ENTER A NUMBER”; cin>> number; while (number !=999) { sum := sum + number; sum := sum + number; counter ++; counter ++; cout <<“\nPlease enter the next number”; cout <<“\nPlease enter the next number”;…

Copyright © Prentice Hall Learning OOP Read booksRead books Use the tutorialsUse the tutorials Study sample codeStudy sample code Write OO codeWrite OO code Start smallStart small Use the help fileUse the help file Use your time productivelyUse your time productively

Copyright © Prentice Hall Conclusion Programming languages have evolved along with the hardware they instruct. In addition, there is a variety of programming languages designed to fit the problem the programmer is trying to solve.