Introduction to Programming in C++ Seventh Edition Chapter 1: An Introduction to Programming.

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

Introduction to Programming
زبانهای برنامه سازی برنامه سازی پیشرفته ارائه دهنده دکتر سيد امين حسيني E.mail: Home page:
PROGRAMMING Introduction To Programming Definition Types Of Programming Languages Programming Language Paradigm Translator
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 © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design First Edition by Tony Gaddis.
Computer Concepts 5th Edition Parsons/Oja Page 546 CHAPTER 11 Software Engineering Section A PARSONS/OJA Computer Programming.
Chapter 16 Programming and Languages: Telling the Computer What to Do.
An Introduction to Programming with C++ Fifth Edition Chapter 1 An Introduction to Programming.
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages C++ Programming:
Intro to Programming CST JavaScript. Objectives Define software Identify the different types of software Differentiate the different types of programming.
Your Interactive Guide to the Digital World Discovering Computers 2012.
DCT 1123 PROBLEM SOLVING & ALGORITHMS INTRODUCTION TO PROGRAMMING.
Computers Are Your Future Tenth Edition Chapter 11: Programming Languages & Program Development Copyright © 2009 Pearson Education, Inc. Publishing as.
Programming Languages CPS120: Introduction to Computer Science Lecture 5.
Chapter 1 An Overview of Computers and Programming Languages.
Computers Are Your Future Eleventh Edition
There are only 10 types of people in the world, those who understand binary and those who don't.
COMPUTER SOFTWARE Section 2 “System Software: Computer System Management ” CHAPTER 4 Lecture-6/ T. Nouf Almujally 1.
Chapter 8 High-Level Programming Languages (modified by Erin Chambers)
Created by, Author Name, School Name—State FLUENCY WITH INFORMATION TECNOLOGY Skills, Concepts, and Capabilities.
CHAPTER 1 Overview of Programming and Problem Solving.
Computer Programming TCP1224 Chapter 2 Beginning the Problem-Solving Process.
An Introduction to Programming with C++ Sixth Edition
Chapter 8 High-Level Programming Languages. 8-2 Chapter Goals Describe the translation process and distinguish between assembly, compilation, interpretation,
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.
Problem Solving using the Science of Computing MSE 2400 EaLiCaRA Spring 2015 Dr. Tom Way.
IXA 1234 : C++ PROGRAMMING CHAPTER 1. PROGRAMMING LANGUAGE Programming language is a computer program that can solve certain problem / task Keyword: Computer.
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages.
INTRODUCTION TO COMPUTING CHAPTER NO. 04. Programming Languages Program Algorithms and Pseudo Code Properties and Advantages of Algorithms Flowchart (Symbols.
Chapter 1 Program design Objectives To describe the steps in the program development process To introduce the current program design methodology To introduce.
The Programming Process Define the problem* Make or buy software? Design the program * Code (write) the program Test (debug) the program Document the.
Introduction to Computer Application (IC) MH Room 517 Time : 7:00-9:30pm.
Chapter 1: An Introduction to Control Structures Introduction to Programming with C++ Fourth Edition.
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 2 I Am Not a Control Freak!
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
1.
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
 Computer Languages Computer Languages  Machine Language Machine Language  Assembly Language Assembly Language  High Level Language High Level Language.
1 Chapter 1 Programming Languages Evolution of Programming Languages To run a Java program: Java instructions need to be translated into an intermediate.
Overview.ppt Overview-An Overview of Visual Basic.NET An Overview of Visual Basic.NET.
Programming Languages
Programming and Languages Dept. of Computer and Information Science IUPUI.
Chapter 1 An Overview of Computers and Programming Languages.
PROGRAMMING FUNDAMENTALS INTRODUCTION TO PROGRAMMING. Computer Programming Concepts. Flowchart. Structured Programming Design. Implementation Documentation.
INTRODUCTION TO COMPUTER PROGRAMMING(IT-303) Basics.
Your Interactive Guide to the Digital World Discovering Computers 2012 Chapter 13 Computer Programs and Programming Languages.
CIS 365: Visual Application Development Introduction to Computers and Programming.
Introduction to computer software. Programming the computer Program, is a sequence of instructions, written to perform a specified task on a computer.
Game programming 1.
Why don’t programmers have to program in machine code?
Programming Languages
CSCI-235 Micro-Computer Applications
Chapter 1: An Overview of Computers and Programming Languages
Algorithm and Ambiguity
Assembler, Compiler, Interpreter
An Introduction to Control Structures
Chapter 1 Introduction(1.1)
The Programming Process
Algorithm and Ambiguity
Assembler, Compiler, Interpreter
An Introduction to Control Structures
ICT Gaming Lesson 2.
Tonga Institute of Higher Education IT 141: Information Systems
An Introduction to Programming with C++ Fifth Edition
Tonga Institute of Higher Education IT 141: Information Systems
1.3.7 High- and low-level languages and their translators
Programming Fundamentals Lecture #2 Overview of Computer Programming
Programming Logic and Design Eighth Edition
Presentation transcript:

Introduction to Programming in C++ Seventh Edition Chapter 1: An Introduction to Programming

PB&J Review Requirements Design Build Test 2

PB&J Review Detailed –Only code doesn’t lie Sequence Repetition Selection 3

A Brief History of Programming Languages There are many different types of programming languages. This chapter will discuss: Machine languages Assembly languages High-level procedure-oriented languages High-level object-oriented languages An Introduction to Programming with C++, Seventh Edition4

5 Machine Languages The first programmers had to write the program instructions using only combinations of 0s and 1s –Example: Instructions written in 0s and 1s are called machine language or machine code Each type of machine has its own language Machine languages are the only way to communicate directly with the computer Programming in machine language: tedious and error- prone; requires highly trained programmers

An Introduction to Programming with C++, Seventh Edition6 Assembly Languages Assembly languages made writing code simpler than using only 0s and 1s Mnemonics – symbols used to represent the actual machine language instructions Example: vs. BALR Assembly programs require an assembler to convert instructions into machine code Easier to write programs in assembly language –But still tedious and requires highly trained programmers

An Introduction to Programming with C++, Seventh Edition7 High-Level Languages High-level languages allow programmers to use English- like instructions Example: taxAmount = total * taxRate Each high-level language instruction is equivalent to more than one machine language instruction Compilers translate high-level instructions into 0s and 1s (machine language)

An Introduction to Programming with C++, Seventh Edition8 High-Level Languages (cont.) When writing a procedure-oriented program, the programmer concentrates on the major tasks that the program needs to perform –Examples: COBOL, BASIC, C An object-oriented program requires the programmer to focus on the objects that the program can use to accomplish its goal –Examples: C++, Visual Basic, Java, C# Object-oriented programs allow for an object to be created that can be reused in more than one program

An Introduction to Programming with C++, Seventh Edition9 Control Structures All computer programs are written using one or more of three basic control structures: sequence, repetition, and selection. Another term used for control structures are logic structures, because they control the logic flow of the program. While in every program that is written the sequence structure will be used, in most all programs all three control structures will be used.

An Introduction to Programming with C++, Seventh Edition10 The Sequence Structure The sequence structure directs the computer to process the program instructions, one after another, in the order in which they are listed in the program An algorithm is a finite number of step-by-step instructions that accomplish a task Example: steps to pump gas at a self-service pump

The Sequence Structure (cont.) An Introduction to Programming with C++, Seventh Edition11 Figure 1-1 An example of the sequence structure

An Introduction to Programming with C++, Seventh Edition12 The Selection Structure The selection structure directs the computer to make a decision (evaluate a condition), and then take an appropriate action based upon that decision The selection structure allows the programmer to evaluate data, therefore properly controlling the logic flow of the program Another name for the selection structure is the decision structure Example: stopping or going at a signal light

The Selection Structure (cont.) An Introduction to Programming with C++, Seventh Edition13 Figure 1-2 An example of the selection structure

An Introduction to Programming with C++, Seventh Edition14 The Selection Structure (cont.) Figure 1-3 Another example of the selection structure

An Introduction to Programming with C++, Seventh Edition15 The Repetition Structure The repetition structure, commonly called iteration or looping, directs the computer to repeat one or more program instructions until some condition is met This condition may be checked at the beginning or end of the set of instructions to be processed dependent upon the language being used The repetition structure allows the programmer to repeatedly process a set of instructions, while only typing them in once

The Repetition Structure (cont.) An Introduction to Programming with C++, Seventh Edition16 Figure 1-4 Original algorithm and modified algorithm showing the repetition structure

An Introduction to Programming with C++, Seventh Edition17 The Repetition Structure (cont.) What could you do if you do not know precisely how many steps separate Harold from the park bench?

The Repetition Structure (cont.) An Introduction to Programming with C++, Seventh Edition18 Repeat until you are directly in front of bench Walk forward End repeat If (Ginger is on the bench) gently shove Ginger off the bench End if Repeat until you are facing away from the bench turn left 90 degrees End repeat Sit down on bench

Summary Programs are step-by-step instructions that tell a computer how to perform a task Programmers use programming languages to communicate with the computer First programming languages were machine language using 0s and 1s Assembly languages followed, using mnemonics High-level languages can be used to created procedure- oriented or object-oriented programs An Introduction to Programming with C++, Seventh Edition19

Summary (cont.) An algorithm is a finite number of step-by-step instructions that accomplish a task Algorithms utilize three basic control structures: sequence, selection, and repetition The sequence structure directs the computer to process the program instructions, one after another, in the order in which they are listed The selection structure directs the computer to make a decision (evaluate a condition), and then take an appropriate action based upon that decision An Introduction to Programming with C++, Seventh Edition20

Summary (cont.) The repetition structure, commonly called iteration or looping, directs the computer to repeat one or more program instructions until some condition is met The sequence structure is used in all programs Most programs also contain both the selection and repetition structures An Introduction to Programming with C++, Seventh Edition21

Assignment Complete Learn an Hour of Code aka “the Zombie game” Code.org/learn Upload your completion certificate to blackboard An Introduction to Programming with C++, Seventh Edition22