C++ Programs to Accompany Programming Logic and Design pot

224 916 1
C++ Programs to Accompany Programming Logic and Design pot

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

[...]... PREFACE C++ Programs to Accompany Programming Logic and Design (also known as C++ PAL) is designed to provide students with an opportunity to write C++ programs as part of an Introductory Programming Logic course It is written to be a companion text to the student’s primary text, Programming Logic and Design, Fifth Edition, by Joyce Farrell This textbook assumes no programming language experience and provides... arithmetic and assignment operators, and using sequential statements to write a complete C++ program In Chapter 3, students learn how to transform pseudocode and flowcharts into C++ programs Chapters 4 and 5 introduce students to writing C++ programs that make decisions and programs that use looping constructs Students learn to use C++ to develop more sophisticated programs that include using arrays and passing... ORGANIZATION AND COVERAGE C++ PAL provides students with a review of the programming concepts they are introduced to in their primary textbook It also shows them how to use C++ to transform their program logic and design into working programs The structure of a C++ program, how to compile and run a C++ console program, and introductory object-oriented concepts are introduced in Chapter 1 Chapter 2 discusses C++ s... following irrelevant and extraneous details The examples in C++ PAL are often examples presented in the primary textbook, Programming Logic and Design, Fifth Edition The following table shows the correlation between topics in the two books C++PAL Programming Logic and Design, Fifth Edition Chapter 1: An Introduction to C++ and the C++ Chapter 1: An Overview of Computers and Logic Programming Environment... finished Chapter 1 of your book, Programming Logic and Design, Fifth Edition, by Joyce Farrell This chapter introduces the C++ programming language and its history It explains some introductory objectoriented concepts, and describes the process of compiling and executing a C++ program You begin writing C++ programs in Chapter 2 of this book THE C++ PROGRAMMING LANGUAGE The C programming language was written... concepts to be successful at reading and working with C++ programs in this book Note, however, that you will not learn enough to make you a C++ programmer You will have to take additional courses in C++ to become a C++ programmer This book teaches you only the basics To fully understand the term “object-oriented,” you need to know a little about procedural programming Procedural programming is a style of programming. .. »NOTE In Programming Logic and Design, Fifth Edition, data type num is used to refer to all numeric data types A distinction is not made between int and double as it is in C++ VARIABLES, OPERATORS, AND WRITING PROGRAMS USING SEQUENTIAL STATEMENTS EXERCISE 2-1: USING C++ VARIABLES, DATA TYPES, AND KEYWORDS In this exercise, you use what you have learned about naming C++ variables, C++ data types, and keywords... programming language and its history Explain introductory concepts and terminology used in object-oriented programming Recognize the structure of a C++ program Complete the C++ development cycle, which includes creating a source code file, compiling the source code, and executing a C++ program 1 AN INTRODUCTION TO C++ AND THE C++ PROGRAMMING ENVIRONMENT You should do the exercises and labs in this chapter... editor such as Notepad AN INTRODUCTION TO C++ AND THE C++ PROGRAMMING ENVIRONMENT EXECUTING A C++ PROGRAM To execute the Hello World program, do the following: »NOTE You must be in the same directory that contains the exe file when you execute the program 1 Open a Command Prompt window To do this in Windows XP, click the Start button, select All Programs, select Accessories, and then select Command... to complete partially pre-written C++ programs Using partially pre-written programs allows students to focus on individual concepts rather than an entire program The labs also allow students the opportunity to see their programs execute C++ PAL is unique because: » It is written and designed to correspond to the topics in the primary textbook, Programming Language and Design, Fifth Edition » The examples . PREFACE C++ Programs to Accompany Programming Logic and Design (also known as C++ PAL) is designed to provide students with an opportunity to write C++ programs. them how to use C++ to transform their program logic and design into working programs. The structure of a C++ program, how to compile and run a C++ console

Ngày đăng: 14/03/2014, 11:20

Từ khóa liên quan

Mục lục

  • Front Cover

  • Title Page

  • Copyright

  • Contents

  • PREFACE

  • READ THIS BEFORE YOU BEGIN

  • CHAPTER 1 AN INTRODUCTION TO C++ AND THE C++ PROGRAMMING ENVIRONMENT

    • THE C++ PROGRAMMING LANGUAGE

    • AN INTRODUCTION TO OBJECT-ORIENTED TERMINOLOGY

    • THE STRUCTURE OF A C++ PROGRAM

    • THE C++ DEVELOPMENT CYCLE

      • Writing C++ Source Code

      • Compiling A C++ Program

      • Executing A C++ Program

      • Exercise 1-1: Understanding the C++ Compiler

      • Lab 1.1: Compiling and Executing A C++ Program

  • CHAPTER 2 VARIABLES, OPERATORS, AND WRITING PROGRAMS USING SEQUENTIAL STATEMENTS

    • VARIABLES

      • Variable Names

      • C++ Data Types

      • Exercise 2-1: Using C++ Variables, Data Types, and Keywords

    • DECLARING AND INITIALIZING VARIABLES

      • Exercise 2-2: Declaring and Initializing C++ Variables

      • Lab 2-1: Declaring and Initializing C++ Variables

    • ARITHMETIC AND ASSIGNMENT OPERATORS

      • Arithmetic Operators

      • Assignment Operators and the Assignment Statement

      • Precedence and Associativity

      • Exercise 2-3: Understanding Operator Precedence and Associativity

      • Lab 2-2: Arithmetic and Assignment Operators

    • SEQUENTIAL STATEMENTS AND INTERACTIVE INPUT STATEMENTS

      • Exercise 2-4: Understanding Sequential Statements

      • Lab 2-3: Using Sequential Statements in a C++ Program

  • CHAPTER 3 WRITING STRUCTURED C++ PROGRAMS

    • USING FLOWCHARTS AND PSEUDOCODE TO WRITE A C++ PROGRAM

      • Lab 3-1: Using Flowcharts and Pseudocode to Write a C++ Program

    • C++ COMMENTS

      • Lab 3-2: Commenting C++ Programs

    • WRITING A MODULAR PROGRAM IN C++

      • Lab 3-3: Writing a Modular Program in C++

  • CHAPTER 4 WRITING PROGRAMS THAT MAKE DECISIONS

    • BOOLEAN OPERATORS

      • Relational Operators

      • Logical Operators

      • Relational and Logical Operator Precedence and Associativity

    • COMPARING STRINGS

    • DECISION STATEMENTS

      • The if Statement

      • Exercise 4-1: Understanding if Statements

      • Lab 4-1: Using if Statements

      • The if-else Statement

      • Exercise 4-2: Understanding if-else Statements

      • Lab 4-2: Using if-else Statements

      • Nested if Statements

      • Exercise 4-3: Understanding Nested if Statements

      • Lab 4-3: Using Nested if Statements

      • The switch Statement

      • Exercise 4-4: Using a switch Statement

      • Lab 4-4: Using a switch Statement

    • USING DECISION STATEMENTS TO MAKE MULTIPLE COMPARISONS

      • Using and Logic

      • Using or Logic

      • Exercise 4-5: Making Multiple Comparisons in Decision Statements

      • Lab 4-5: Making Multiple Comparisons in Decision Statements

  • CHAPTER 5 WRITING PROGRAMS USING LOOPS

    • THE INCREMENT (++) AND DECREMENT (--) OPERATORS

      • Exercise 5-1: Using the Increment and Decrement Operators

    • WRITING A WHILE LOOP IN C++

      • Exercise 5-2: Using a while Loop

      • Using a Counter to Control a Loop

      • Exercise 5-3: Using a Counter-Controlled while Loop

      • Lab 5-1: Using a Counter-Controlled while Loop

      • Using a Sentinel Value to Control a Loop

      • Exercise 5-4: Using a Sentinel Value to Control a while Loop

      • Lab 5-2: Using a Sentinel Value to Control a while Loop

    • WRITING A FOR LOOP IN C++

      • Exercise 5-5: Using a for Loop

      • Lab 5-3: Using a for Loop

    • WRITING A DO-WHILE LOOP IN C++

      • Exercise 5-6: Using a do-while Loop

      • Lab 5-4: Using a do-while Loop

    • NESTING LOOPS

      • Exercise 5-7: Nesting Loops

      • Lab 5-5: Nesting Loops

    • ACCUMULATING TOTALS IN A LOOP

      • Exercise 5-8: Accumulating Totals in a Loop

      • Lab 5-6: Accumulating Totals in a Loop

    • USING A LOOP TO VALIDATE INPUT

      • Exercise 5-9: Validating User Input

      • Lab 5-7: Validating User Input

  • CHAPTER 6 USING ARRAYS IN C++ PROGRAMS

    • ARRAY BASICS

      • Declaring Arrays

      • Initializing Arrays

      • Accessing Array Elements

      • Staying Within the Bounds of an Array

      • Using Constants with Arrays

      • Exercise 6-1: Array Basics

      • Lab 6-1: Using Arrays

    • SEARCHING AN ARRAY FOR AN EXACT MATCH

      • Exercise 6-2: Searching an Array for an Exact Match

      • Lab 6-2: Searching an Array for an Exact Match

    • PARALLEL ARRAYS

      • Exercise 6-3: Parallel Arrays

      • Lab 6-3: Parallel Arrays

  • CHAPTER 7 USING FUNCTIONS IN C++ PROGRAMS

    • A SIMPLE C++ FUNCTION

      • Exercise 7-1: Writing Simple Functions

      • Lab 7-1: Writing Simple Functions

    • WRITING FUNCTIONS THAT REQUIRE A SINGLE PARAMETER

      • Exercise 7-2: Writing Functions that Require a Single Parameter

      • Lab 7-2: Writing Functions that Require a Single Parameter

    • WRITING FUNCTIONS THAT REQUIRE MULTIPLE PARAMETERS

      • Exercise 7-3: Writing Functions that Require Multiple Parameters

      • Lab 7-3: Writing Functions that Require Multiple Parameters

    • WRITING FUNCTIONS THAT RETURN A VALUE

      • Exercise 7-4: Writing Functions that Return a Value

      • Lab 7-4: Writing Functions that Return a Value

    • PASSING AN ARRAY AND AN ARRAY ELEMENT TO A FUNCTION

      • Exercise 7-5: Passing Arrays to Functions

      • Lab 7-5: Passing Arrays to Functions

    • PASSING ARGUMENTS BY REFERENCE AND BY ADDRESS

      • Pass by Reference

      • Pass by Address

      • Exercise 7-6: Pass by Reference and Pass by Address

      • Lab 7-6: Pass by Reference and Pass by Address

    • OVERLOADING FUNCTIONS

      • Exercise 7-7: Overloading Functions

      • Lab 7-7: Overloading Functions

    • USING C++ BUILT-IN FUNCTIONS

      • Exercise 7-8: Using C++’s Built-in Functions

      • Lab 7-8: Using C++’s Built-in Functions

  • CHAPTER 8 WRITING CONTROL BREAK PROGRAMS

    • ACCUMULATING TOTALS IN SINGLE-LEVEL CONTROL BREAK PROGRAMS

      • Exercise 8-1: Accumulating Totals in Single-Level Control Break Programs

      • Lab 8-1: Accumulating Totals in Single-Level Control Break Programs

    • MULTIPLE-LEVEL CONTROL BREAK PROGRAMS

      • Exercise 8-2: Multiple-Level Control Break Programs

      • Lab 8-2: Multiple-Level Control Break Programs

  • CHAPTER 9 SORTING DATA AND FILE INPUT/OUTPUT

    • SORTING DATA

    • SWAPPING DATA VALUES

      • Exercise 9-1: Swapping Values

      • Lab 9-1: Swapping Values

    • USING A BUBBLE SORT

      • The main Function

      • The fillarray Function

      • The sortArray Function

      • The displayArray Function

      • Exercise 9-2: Using a Bubble Sort

      • Lab 9-2: Using a Bubble Sort

    • FILE INPUT AND OUTPUT

      • Using Input and Output Classes

      • Opening a File for Reading

    • READING DATA FROM AN INPUT FILE

      • Reading Data Using a Loop and EOF

      • Opening a File for Writing

      • Writing Data to an Output File

      • Exercise 9-3: Opening Files and Performing File Input

      • Lab 9-3: Using an Input File

  • CHAPTER 10 OBJECT ORIENTED C++

    • A PROGRAMMER-DEFINED CLASS

      • Creating a Programmer-Defined Class

      • Adding Attributes to a Class

      • Adding Methods to a Class

      • Exercise 10-1: Creating a Class in C++

      • Lab 10-1: Creating a Class in C++

    • REUSING C++ CLASSES

      • Defining a Derived Class

      • Using a Derived Class in a C++ Program

      • Exercise 10-1: Using Inheritance to Create a Derived Class in C++

      • Lab 10-2: Using Inheritance to Create a Derived Class in C++

  • INDEX

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan