What is Programming? A program is a list of instructions that is executed by a computer to accomplish a particular task. Creating those instructions is.

Slides:



Advertisements
Similar presentations
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Advertisements

Chapter 2: Modularization
Computers Are Your Future
Programming Logic and Design Fourth Edition, Introductory
CHAPTER 1: AN OVERVIEW OF COMPUTERS AND LOGIC. Objectives 2  Understand computer components and operations  Describe the steps involved in the programming.
Chapter 1: Introduction
Programming Logic and Design Fourth Edition, Introductory
Programming Creating programs that run on your PC
COSC 120 Computer Programming
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design First Edition by Tony Gaddis.
The Analytical Engine Module 6 Program Translation.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Computers: Tools for an Information Age
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Sixth Edition by Tony Gaddis, Judy Walters,
An Overview of Programming Logic and Design
Understanding the Mainline Logical Flow Through a Program (continued)
An Introduction to Programming with C++ Fifth Edition Chapter 1 An Introduction to Programming.
Programming Logic and Design, Introductory, Fourth Edition1 Understanding Computer Components and Operations (continued) A program must be free of syntax.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
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.
Programming Logic and Design Fourth Edition, Introductory
An Overview of Computers and Programming
CSE 1301 J Lecture 2 Intro to Java Programming Richard Gesick.
© Paradigm Publishing Inc Chapter 12 Programming Concepts and Languages.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Alternate Version of STARTING OUT WITH C++ 4 th Edition Chapter 1 Introduction to Computers and Programming.
Why Program? Computer – programmable machine designed to follow instructions Program – instructions in computer memory to make it do something Programmer.
CHAPTER 4: INTRODUCTION TO COMPUTER ORGANIZATION AND PROGRAMMING DESIGN Lec. Ghader Kurdi.
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.
© 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.
The abacus has roots dating back over 5,000 years
CIS Computer Programming Logic
สาขาวิชาเทคโนโลยี สารสนเทศ คณะเทคโนโลยีสารสนเทศ และการสื่อสาร.
Chapter 1.4 Programming languages Homework Due: Monday, August 11, 2014.
Programming. What is a Program ? Sets of instructions that get the computer to do something Instructions are translated, eventually, to machine language.
Chapter 1: Introduction to Computers and Programming.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
CISC105 General Computer Science Class 1 – 6/5/2006.
Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and Elizabeth Drake Chapter 0: Introduction.
Computer Programming A program is a set of instructions a computer follows in order to perform a task. solve a problem Collectively, these instructions.
Introduction to Computer Systems and the Java Programming Language.
Java Programming, Second Edition Chapter One Creating Your First Java Program.
S2008Final_part1.ppt CS11 Introduction to Programming Final Exam Part 1 S A computer is a mechanical or electrical device which stores, retrieves,
Lecture 1 Introduction Figures from Lewis, “C# Software Solutions”, Addison Wesley Richard Gesick.
Chapter 1 Introduction Chapter 1 Introduction 1 st Semester 2015 CSC 1101 Computer Programming-1.
An Object-Oriented Approach to Programming Logic and Design Chapter 1 An Overview of Computers and Logic.
Basic of Programming Language Skill Area Computer System Computer Program Programming Language Programmer Translators.
COMPUTER PROGRAMMING. Computer programming the objective of the module to gain the necessary skills to develop a computer program using one of the high.
Cs413_design04.ppt Design and Software Development Design : to create a functional interface that has high usability Development : an organized approach.
Computing System Fundamentals 3.1 Language Translators.
Chapter 1 : Overview of Computer and Programming By Suraya Alias
Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
Programming and Languages Dept. of Computer and Information Science IUPUI.
Chapter 1: Introduction to Visual Basic.NET: Background and Perspective Visual Basic.NET Programming: From Problem Analysis to Program Design.
Alexandria University Faculty of Science Computer Science Department Introduction to Programming C++
Chapter 1: Introduction to Computers and Programming.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
Introduction to Computer Programming Concepts M. Uyguroğlu R. Uyguroğlu.
Programming Logic and Design Seventh Edition Chapter 1 An Overview of Computers and Programming.
 Human language : commonly used to express feeling and understand what other people expression.  Computer language : are a languages by which a user.
CSCI-235 Micro-Computer Applications
Assembler, Compiler, Interpreter
Assembler, Compiler, Interpreter
PROGRAMMING FUNDAMENTALS Lecture # 03. Programming Language A Programming language used to write computer programs. Its mean of communication between.
ICT Programming Lesson 1:
ICS103 Programming in C 1: Overview of Computers And Programming
Programming Logic and Design Eighth Edition
Presentation transcript:

What is Programming? A program is a list of instructions that is executed by a computer to accomplish a particular task. Creating those instructions is programming by a programmer

Programming language: Special language (like French or German) Understood by the computer Tells the computer what to do Used by a programmer to write a program Visual Basic, Java, C#, C++, COBOL Machine language: Language of the computer Every “Programmer” language is converted to machine language Consists of bits on or off only Compiler or interpreter: Software that translates programming languages to machine language

Using software to translate the program into machine language: Coding the program: Select the programming language Write the instructions Using software to translate the program into machine language: Programmers write instructions in English-like high-level languages Compilers or interpreters change the programs into low-level machine language that can be executed Syntax errors are identified by the compiler or interpreter

Binary Machine Language – all data types consist of 1s and 0s 1 bit (0 or 1) 4 bits = nibble 1 byte = 8 bits = 2 nibbles Is the storage for one character 1 word = 4 bytes 1 K = 1 KB = 1 kilobyte = 1,0240 bytes = 210 bytes Kilo = 1,000 : 1 KB = 1,000 bytes 1 Meg = 1 megabyte (MB) = 1 million = 1024 KB 1 GB = 1 gigabyte (GB) = 1024 MB = 1,000,000,000 Many people approximate to steps of 1000, not 1024

Programming Languages Machine Languages 0110110111110111 0000000100000000 0000000100000000 Assembly Languages One programmer instruction converted to 1 machine level instruction ADD A,B High-level Languages Looks more like English words and algebraic expressions Examples of high level languages Programmer instruction converted to many machine level ADA BASIC C++ FORTRAN COBOL Java Pascal Visual Basic

Machine Language Generation Programmer written computer code Programmer written computer code Translator (Interpreter) Program (browser) Compiler Assembler One Machine Language Instruction FUNCTION Browsers netscape MS Explorer Javascript PHP ASP Many machine Language Instructions .exe file Execute Execute MS Word, Windows XP, MS Excel, Vista, MS Explorer

Writing Programs To write a program in a high-level language, you need: Appropriate software A text editor to type and edit program statements A debugger to help find errors in program code A compiler or interpreter to translate the program into machine language

Error Types Syntax: the rules governing word usage and punctuation in the language (format, recipe, formula) Logic errors are more difficult to locate than syntax errors

Syntax Error Cycle

A program must be free of syntax errors to be run, or executed, on a computer The program will not compile or be translated A message will point out the offending instruction To function properly, the logic must be correct The program will still execute The output may be incorrect The program may exit prematurely The program may ABEND (Abnormal Termination) The program may execute with no errors/problems

Logic A program must be free of syntax errors to be run, or executed, on a computer To function properly, the logic must be correct What’s wrong with this logic for making a cake?

Two major programming techniques: Procedural programming Object-oriented programming Procedural programming: focuses on the procedures that programmers create Object-oriented programming: focuses on objects that represent real-world things and their attributes and behaviors Both techniques employ reusable program modules

Mainline Logical Flow Through a Program Procedural program: one procedure follows another from beginning to end Mainline logic has three distinct parts: Housekeeping: steps to get ready Main loop: instructions executed for every input record End-of-job: steps taken at end of program Break the logic down into at least three modules

Mainline Logical Flow Through a Program

Mainline Logical Flow Through a Program Modularization of the program: Keeps the job manageable Allows multiple programmers to work simultaneously Keeps the program structured

Housekeeping Tasks Housekeeping tasks: include all steps that occur at the beginning of the program Declare variables Open files Perform one-time-only tasks such as printing headings Read the first input record

Annotate the Output If the output consists of numbers or any data that has no explanatory text with it, you should annotate your output – this means to add some text so the user knows what the output means.