Chapter 3: Completing the Problem- Solving Process and Getting Started with C++ Introduction to Programming with C++ Fourth Edition.

Slides:



Advertisements
Similar presentations
C++ Introduction.
Advertisements

An Introduction to Programming with C++ Fifth Edition Chapter 3 Completing the Problem-Solving Process and Getting Started with C++
Chapter 1: Introduction
Starting Out with C++, 3 rd Edition 1 Chapter 1. Introduction to Computers and Programming.
© Janice Regan, CMPT 102, Sept CMPT 102 Introduction to Scientific Computer Programming The software development method algorithms.
Three types of computer languages
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
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 1: An Overview of Computers and Programming Languages
 2003 Prentice Hall, Inc. All rights reserved. 1 Machine Languages, Assembly Languages, and High-level Languages Three types of computer languages 1.Machine.
Chapter 1: An Overview of Computers 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.
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages C++ Programming:
Moving To Code 3 More on the Problem-Solving Process §The final step in the problem-solving process is to evaluate and modify (if necessary) the program.
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.
1 Chapter Two Introduction to the Programming Language C.
Chapter 1: Introduction To Computer | SCP1103 Programming Technique C | Jumail, FSKSM, UTM, 2005 | Last Updated: July 2005 Slide 1 Introduction To Computers.
Copyright 2003 Scott/Jones Publishing Brief Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
CS102 Introduction to Computer Programming
Principles of Programming Chapter 1: Introduction  In this chapter you will learn about:  Overview of Computer Component  Overview of Programming 
Chapter Introduction to Computers and Programming 1.
Introduction 01_intro.ppt
1 Chapter One A First Program Using C#. 2 Objectives Learn about programming tasks Learn object-oriented programming concepts Learn about the C# programming.
CSC 125 Introduction to C++ Programming Chapter 1 Introduction to Computers and Programming.
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.
Copyright © 2012 Pearson Education, Inc. 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: A First Program Using C#. Programming Computer program – A set of instructions that tells a computer what to do – Also called software Software.
Chapter 2: Beginning the Problem-Solving Process
Computer Programming A program is a set of instructions a computer follows in order to perform a task. solve a problem Collectively, these instructions.
Computer Programming TCP1224 Chapter 3 Completing the Problem-Solving Process and Getting Started with C++
Introduction to C++ Programming Language
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
1 Problem Solving with C++ The Object of Programming Walter Savitch Chapter 1 Introduction to Computers and C++ Programming Slides by David B. Teague,
Practice and Evaluation. Practice Develop a java class called: SumCalculator.java which computes a sum of all integer from 1 to 100 and displays the result.
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.
An Introduction to Programming with C++ Sixth Edition Chapter 7 The Repetition Structure.
1 Program Planning and Design Important stages before actual program is written.
Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
Agenda Computer Languages How to Write a Simple C Program
How to Program? -- Part 1 Part 1: Problem Solving –Analyze a problem –Decide what steps need to be taken to solve it. –Take into consideration any special.
An Introduction to Programming with C++ Sixth Edition Chapter 10 Void Functions.
An Introduction to Programming with C++ Sixth Edition
Brief Version of Starting Out with C++ Chapter 1 Introduction to Computers and Programming.
Chapter 1: Introduction to Visual Basic.NET: Background and Perspective Visual Basic.NET Programming: From Problem Analysis to Program Design.
Principles of Programming CSEB134 : BS/ CHAPTER Fundamentals of the C Programming Language.
Copyright © 2014 Pearson Addison-Wesley. All rights reserved. Chapter 2 C++ Basics.
Chapter 7 What’s Wrong with It? (Syntax and Logic Errors) Clearly Visual Basic: Programming with Visual Basic nd Edition.
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.
Microsoft Visual Basic 2012: Reloaded Fifth Edition Chapter One An Introduction to Visual Basic 2012.
Chapter 1: Introduction to Computers and Programming.
CHAPTER 3 COMPLETING THE PROBLEM- SOLVING PROCESS AND GETTING STARTED WITH C++ An Introduction to Programming with C++ Fifth Edition.
An Introduction to Programming with C++1 Beginning the Problem- Solving Process Tutorial 2.
Intro. to Computer Programming Eng. Nehal A. Mohamed Spring Semester-2016.
Java Programming Fifth Edition Chapter 1 Creating Your First Java Classes.
Software Engineering Algorithms, Compilers, & Lifecycle.
An Introduction to Programming with C++ Sixth Edition Chapter 8 More on the Repetition Structure.
Chapter 9: Value-Returning Functions
Introduction to Computers and C++ Programming
1-1 Logic and Syntax A computer program is a solution to a problem.
Completing the Problem-Solving Process
Chapter 1: An Overview of Computers and Programming Languages
C++ Programming: From Problem Analysis to Program Design
Introduction to Computer Programming
Chapter 1 Introduction(1.1)
Presentation transcript:

Chapter 3: Completing the Problem- Solving Process and Getting Started with C++ Introduction to Programming with C++ Fourth Edition

Introduction to Programming with C++, Fourth Edition2 Objectives Code an algorithm into a program Desk-check a program Evaluate and modify a program Differentiate among source code, object code, and executable code Understand the components of a C++ program

Introduction to Programming with C++, Fourth Edition3 Objectives (continued) Create a Visual C++.NET solution, project, and source file Open a Visual C++.NET solution Save, build, and execute a C++ program Locate an error in a C++ program Make a backup copy of a solution

Introduction to Programming with C++, Fourth Edition4 More on the Problem-Solving Process

Introduction to Programming with C++, Fourth Edition5 Coding the Algorithm into a Program

Introduction to Programming with C++, Fourth Edition6 Coding the Algorithm into a Program (continued) IPO chart shows: –Input, processing, and output items –Algorithm needed to solve the problem The algorithm shows the steps to calculate and display Sarah’s new weekly pay The calculation is based on the current weekly pay and raise rate values entered by the user Algorithm also calculates an intermediate value, weekly raise

Introduction to Programming with C++, Fourth Edition7 Coding the Algorithm into a Program (continued)

Introduction to Programming with C++, Fourth Edition8 Assigning Names, Data Types, and Initial Values to the IPO Items Assign a descriptive name to each unique input, processing, and output item listed in the IPO Be aware of naming rules Assign a data type to each input, processing, and output item Assign an initial value

Introduction to Programming with C++, Fourth Edition9 Assigning Names, Data Types, and Initial Values to the IPO Items (continued)

Introduction to Programming with C++, Fourth Edition10 Translating the Algorithm Steps into C++ Code

Introduction to Programming with C++, Fourth Edition11 Desk-Checking the Program

Introduction to Programming with C++, Fourth Edition12 Desk-Checking the Program (continued)

Introduction to Programming with C++, Fourth Edition13 Desk-Checking the Program (continued)

Introduction to Programming with C++, Fourth Edition14 Desk-Checking the Program (continued)

Introduction to Programming with C++, Fourth Edition15 Desk-Checking the Program (continued)

Introduction to Programming with C++, Fourth Edition16 Evaluating and Modifying the Program Debugging - the process of locating and removing any errors, called bugs, in a program Program errors can be either syntax errors or logic errors You create a syntax error when you enter an instruction that violates the programming language’s syntax

Introduction to Programming with C++, Fourth Edition17 Evaluating and Modifying the Program (continued) Logic errors - much more difficult to find because they can occur for a variety of reasons and do not trigger an error message from the compiler

Introduction to Programming with C++, Fourth Edition18 Creating a C++ Program C++ evolved from the procedure-oriented C programming language, which was developed in 1972 at Bell Laboratories by Dennis Ritchie In 1985, Bjarne Stroustrup (Bell Laboratories) added object-oriented features to C C++ is a superset of C Source code - C++ instructions Source file – contains the source code

Introduction to Programming with C++, Fourth Edition19 Creating a C++ Program (continued) Object code - the 0s and 1s that the computer can understand Object file - the file containing the object code Linker - combines the object file with other machine code necessary for your C++ program to run correctly Executable file - contains all of the machine code necessary to run your C++ program

Introduction to Programming with C++, Fourth Edition20 Process by which Source Code is Translated into Executable Code

Introduction to Programming with C++, Fourth Edition21

Introduction to Programming with C++, Fourth Edition22 Creating a C++ Program Comment (internal documentation) - a message to the person reading the program Function - a block of code that performs a task Void functions – do not return values after completing their assigned tasks Function header - marks the beginning of the function Function body - everything between the opening and closing braces

Introduction to Programming with C++, Fourth Edition23 Summary After analyzing a problem, code the algorithm into a program Desk-check the program to verify that the algorithm was correctly translated Evaluate and modify if necessary Program errors can be either: –Syntax: violate a rule of the language –Logic: error in the algorithm

Introduction to Programming with C++, Fourth Edition24 Summary (continued) To create and execute a C++ program, you need to have a text editor and a C++ compiler Source code is C++ instructions you enter The compiler translates source code into machine code, or object code Linker produces an executable file containing all of the machine code to run your C++ program

Introduction to Programming with C++, Fourth Edition25 Summary (continued) Programs have various components: –Comments –Directives –using statements –Functions