Chapter 1 Introduction(1.1)

Slides:



Advertisements
Similar presentations
CHAPTER 2 GC101 Program’s algorithm 1. COMMUNICATING WITH A COMPUTER  Programming languages bridge the gap between human thought processes and computer.
Advertisements

Chapter 1 An Overview of Computers and Programming Languages.
Lecture 1: Overview of Computers & Programming
Copyright © 2002 W. A. Tucker1 Chapter 1 Lecture Notes Bill Tucker Austin Community College COSC 1315.
© Janice Regan, CMPT 102, Sept CMPT 102 Introduction to Scientific Computer Programming The software development method algorithms.
Chapter 1: An Overview of Computers and Programming Languages J ava P rogramming: From Problem Analysis to Program Design, From Problem Analysis to Program.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Computers: Tools for an Information Age
Chapter 1 Introduction to C Programming. 1.1 INTRODUCTION This book is about problem solving with the use of computers and the C programming language.
Chapter 1: An Overview of Computers and Programming Languages
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages C++ Programming:
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Chapter 8: Introduction to High-level Language Programming Invitation to Computer Science, C++ Version, Third Edition.
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.
PRE-PROGRAMMING PHASE
Computer Programming-1 CSC 111 Chapter 1 : Introduction.
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 Introduction to Computers and Programming 1.
Introduction to Programming Dr Masitah Ghazali Programming Techniques I SCJ1013.
CSC 125 Introduction to C++ Programming Chapter 1 Introduction to Computers and Programming.
Chapter 1 An Overview of Computers and Programming Languages.
© 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.
計算機程式語言 Lecture 01-1 國立臺灣大學生物機電系 1 1 Preliminaries.
Invitation to Computer Science 5 th Edition Chapter 9 Introduction to High-Level Language Programming.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming 1.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Chapter 1: Introduction to Computers and Programming.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
Chapter 1: Preliminaries. Objectives In this chapter, you will learn about: Unit analysis Exponential and scientific notations Software development Algorithms.
A First Book of ANSI C Fourth Edition
Invitation to Computer Science 5 th Edition Chapter 6 An Introduction to System Software and Virtual Machine s.
IXA 1234 : C++ PROGRAMMING CHAPTER 1. PROGRAMMING LANGUAGE Programming language is a computer program that can solve certain problem / task Keyword: Computer.
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.
Introduction to Computer Application (IC) MH Room 517 Time : 7:00-9:30pm.
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.
1 Overview of Programming Principles of Computers.
C++ for Engineers and Scientists, Second Edition 1 Problem Solution and Software Development Software development procedure: method for solving problems.
Evolution of C and C++ n C was developed by Dennis Ritchie at Bell Labs (early 1970s) as a systems programming language n C later evolved into a general-purpose.
PROGRAMMING FUNDAMENTALS INTRODUCTION TO PROGRAMMING. Computer Programming Concepts. Flowchart. Structured Programming Design. Implementation Documentation.
INTRODUCTION TO COMPUTER PROGRAMMING(IT-303) Basics.
Chapter 1: Introduction to Computers and Programming.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
Victoria Ibarra Mat:  Generally, Computer hardware is divided into four main functional areas. These are:  Input devices Input devices  Output.
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 to Computers and Programming
Chapter 1 Introduction 2nd Semester H
BASIC PROGRAMMING C SCP1103 (02)
Computer Programming (BCT 1113)
CSCI-235 Micro-Computer Applications
Chapter 1: An Overview of Computers and Programming Languages
BASIC PROGRAMMING C SCP1103 (02)
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Chapter 1: An Overview of Computers and Programming Languages
C++ Programming: From Problem Analysis to Program Design
An Introduction to Visual Basic .NET and Program Design
Chapter 1: Introduction to Computers and Programming
King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1 Done By: Asmal Alosaimi Edited By: Fatimah Alakeel.
CSC128 FUNDAMENTALS OF COMPUTER PROBLEM SOLVING
King Saud University College Of Applied Studies and Community Services CSC 1101 Computer Programming-1 Done By: Asmal Alosaimi Edited By: Fatimah Alakeel.
Introduction to Computer Programming
ICT Gaming Lesson 2.
Chapter 1: Preliminaries
Computer Programming-1 CSC 111
ICS103 Programming in C 1: Overview of Computers And Programming
Programming Logic and Design Eighth Edition
Chapter 1: Introduction to Computers and Programming
Presentation transcript:

Chapter 1 Introduction(1.1)

Objectives Introduction to Programming Problem Solution and Software Development Algorithms C++ for Engineers and Scientists,

Introduction to Programming Program: self-contained set of instructions used to operate a computer to produce a specific result Also called software Programming: the process of writing a program, or software Programming language-The set of instruction that can be used to construct a program C++ for Engineers and Scientists, Second Edition

Machine Language Although the previous algorithm defines the steps for calculating the gross pay, it is not ready to be executed on the computer. The computer only executes machine language instructions.

Machine Language Machine language instructions are binary numbers, such as 1011010000000101 Rather than writing programs in machine language, programmers use programming languages.

Programs and Programming Languages Types of languages: Low-level: used for communication with computer hardware directly. Often written in binary machine code (0’s/1’s) directly. languages that use instructions tied directly to one type of computer Examples: machine language, assembly language

-closer to human language High-level: -closer to human language -instructions resemble written languages, such as English,and can be run on a variety of computer types Examples: Visual Basic, C, C++, Java C++ for Engineers and Scientists, Second Edition

Introduction to Programming: Assembly Language (continued) C++ for Engineers and Scientists, Second Edition

Introduction to Programming: Low- and High-Level Languages (continued) Source code: the programs written in a high- or low-level language Source code must be translated to machine instructions in one of two ways: Interpreter: each statement is translated individually and executed immediately after translation Compiler: all statements are translated and stored as an executable program, or object program; execution occurs later C++ for Engineers and Scientists, Second Edition

Some Well-Known Programming Languages

Introduction to Programming: Low- and High-Level Languages (continued) Large C++ programs may be stored in two or more separate program files due to Use of previously written code Use of code provided by the compiler Modular design of the program (for reusability of components) Linker: combines all of the compiled code required for the program C++ for Engineers and Scientists, Second Edition

Introduction to Programming: Procedural and Object Orientations (continued) Figure 1.2 Creating an executable C++ program. C++ for Engineers and Scientists, Second Edition

Example Algorithm for Calculating Gross Pay

From a High-level Program to an Executable File Create file containing the program with a text editor. Run preprocessor to convert source file directives to source code program statements. Run compiler to convert source program into machine instructions. Run linker to connect hardware-specific code to machine instructions, producing an executable file. Steps b–d are often performed by a single command or button click. Errors detected at any step will prevent execution of following steps.

Introduction to Programming: Application and System Software Application software: programs written to perform particular tasks for users System software: collection of programs to operate the computer system System software must be loaded first; called booting the system Bootstrap loader: a permanent, automatically executed component to start the boot process C++ for Engineers and Scientists, Second Edition

Introduction to Programming: Application and System Software (continued) Operating system: the set of system programs used to operate and control a computer; also called OS Tasks performed by the OS include Memory management Allocation of CPU time Control of input and output Management of secondary storage devices C++ for Engineers and Scientists, Second Edition

Introduction to Programming: The Development of C++ The purpose of most application programs is to process data to produce specific results Figure 1.3 Basic procedural operations. C++ for Engineers and Scientists, Second Edition

Introduction to Programming: The Development of C++ (continued) Early object-oriented language: C++ C++ for Engineers and Scientists, Second Edition

Problem Solution and Software Development Software development procedure: method for solving problems and creating software solutions Consists of three phases: Phase I: Development and Design Phase II: Documentation Phase III: Maintenance Software engineering: discipline concerned with creating efficient, reliable, maintainable software C++ for Engineers and Scientists, Second Edition

Problem Solution and Software Development (continued) Figure 1.6 The three phases of software development. C++ for Engineers and Scientists, Second Edition

Problem Solution and Software Development: Phase I Problem Solution and Software Development: Phase I. Development and Design Program requirement: request for a program or a statement of a problem After a program requirement is received, Phase I begins Phase I consists of four steps: Analysis Design Coding Testing C++ for Engineers and Scientists, Second Edition

Problem Solution and Software Development: Phase I (continued) Figure 1.7 The development and design steps. C++ for Engineers and Scientists, Second Edition

Problem Solution and Software Development: Phase I (continued) Step 1: Analyze the Problem Analyst must understand What outputs are required What inputs will be needed How the inputs can be used to produce the desired outputs Failure to analyze and understand the requirements leads to a failed solution! C++ for Engineers and Scientists, Second Edition

Problem Solution and Software Development: Phase I (continued) Step 2: Develop a Solution Algorithm: the exact steps used to solve a problem Algorithm is usually defined at high level, then refined to detailed lower levels Structure level diagrams may be used to represent the levels of analysis C++ for Engineers and Scientists, Second Edition

Algorithms Algorithm: the step-by-step sequence of instructions that describe how the data is to be processed to produce the desired output Programming = the translation of the selected algorithm into a language the computer can use C++ for Engineers and Scientists, Second Edition

Algorithms (continued) Pseudocode: English-like phrases used to describe the algorithm Formula: description of a mathematical equation Flowchart: diagram showing the flow of instructions in an algorithm Flowcharts use special symbols C++ for Engineers and Scientists, Second Edition

Problem Solution and Software Development: Phase I (continued) Figure 1.8 First-level structure diagram. C++ for Engineers and Scientists, Second Edition

Problem Solution and Software Development: Phase I (continued) Figure 1.9 Second-level refinement structure diagram. C++ for Engineers and Scientists, Second Edition

Problem Solution and Software Development: Phase I (continued) Step 3: Code the Solution Also called writing the program, and implementing the solution Program should contain well-defined patterns or structures of the following types: Sequence Selection Iteration Invocation C++ for Engineers and Scientists, Second Edition

Problem Solution and Software Development: Phase I (continued) Sequence: defines the order in which instructions are executed Selection: allows a choice between different operations, based on some condition Iteration: allows the same operation to be repeated based on some condition; also called looping or repetition Invocation: involves invoking a set of statements when needed C++ for Engineers and Scientists, Second Edition

Problem Solution and Software Development: Phase I (continued) Step 4: Test and Correct the Program Testing: method to verify correctness and that requirements are met Bug: a program error Debugging: the process of locating an error, and correcting and verifying the correction Testing may reveal errors, but does not guarantee the absence of errors C++ for Engineers and Scientists, Second Edition

Problem Solution and Software Development: Phase I (continued) Testing requires the use of meaningful, representative test data Impossible to test all possible combinations of data and operations in a complex program Testing plans must be developed to ensure good coverage in testing Testing usually requires more time than other steps in Phase I C++ for Engineers and Scientists, Second Edition

Problem Solution and Software Development: Phase I (continued) Relative effort for steps in Phase I C++ for Engineers and Scientists, Second Edition

Problem Solution and Software Development: Phase II. Documentation Many documents may be required, including Program description Algorithm development and changes Well-commented program listing Sample test runs Users’ manual C++ for Engineers and Scientists, Second Edition

Problem Solution and Software Development: Phase III. Maintenance Maintenance includes Ongoing correction of newly discovered bugs Revisions to meet changing user needs Addition of new features Maintenance usually the longest phase, and may be the primary source of revenue Good documentation vital for effective maintenance C++ for Engineers and Scientists, Second Edition

Problem Solution and Software Development: Backup Backup: process of making copies of program code and documentation on a regular basis Backup copies = insurance against loss or damage Consider using off-site storage for additional protection C++ for Engineers and Scientists, Second Edition

Integrated Development Environments (IDEs) An integrated development environment, or IDE, combine all the tools needed to write, compile, and debug a program into a single software application. Examples are Microsoft Visual C++, Borland C++ Builder, CodeWarrior, etc.

Integrated Development Environments (IDEs)

Summary Software: programs used to operate a computer Programming language types: Low-level languages Machine language (executable) programs Assembly languages High-level languages Compiler and interpreter languages C++ for Engineers and Scientists, Second Edition

Summary (continued) Software engineering: discipline concerned with creating readable, efficient, reliable, and maintainable programs Three phases in software development: Program development and design Documentation Maintenance C++ for Engineers and Scientists,

Summary (continued) Four steps in program development and design: Analyze the problem Develop a solution Code the solution Test and correct the solution Algorithm: step-by-step procedure that describes how a task is performed Computer program: self-contained unit of instructions and data used to operate a computer to produce a desired result C++ for Engineers and Scientists,

Summary (continued) Sequence Selection Iteration Invocation Four fundamental control structures used in coding: Sequence Selection Iteration Invocation C++ for Engineers and Scientists, Second Edition

Analyze and design(input, output, process) the solution (flowchart) for each of question to read three numbers and find their product. displays the area of a rectangle by accepting length and width from the user. will read the radius of a circle and calculate and display its perimeter. that will accept the radius of a circle and calculate and display its area that will accept three numbers and calculate and display the total of the three. that will accept the marks in a test for a group of 25 students then calculate and display the average mark.   C++ for Engineers and Scientists, Second Edition