وبلاگ بلیان

Structured Programming with C++

معرفی کتاب «Structured Programming with C++» نوشتهٔ Kjell Backman، منتشرشده توسط نشر Bookboon.com در سال 2015. این کتاب در فرمت pdf، زبان انگلیسی ارائه شده است. «Structured Programming with C++» در دستهٔ بدون دسته‌بندی قرار دارد.

This book is intended as course material for the course Structured Programming with C/C++ at university level. It contains eight chapters, one for each lecture of the course. The purpose of the course Structured Programming with C/C++ is primarily to teach how to ”think programming” and secondarily to teach C++ code. Therefore, the author of the book says, I will emphasize how to focus on the problem solution and prepare the coding. JSP (Jackson Structured Programming) is a common tool within programming and is used to structure a problem. You will learn how to use JSP to build your solution. Flow chart is an alternate tool to JSP, which we also will make some notice to. Primarily, this is a beginnerâ€TMs course in C, but we will utilize some C++ tools for e.g. input and output. Learning to program is not made in short time. It requires long-term and patient work with reading, coding, testing and debugging. There is no shortcut, but if you work with endurance, you will have many times of inspiration and nice experiences. In this book the readers will read Introduction to programming, What does it mean to program, Coding, Compiling and linking, The first steps with visual C++, Variables, Why variables, Declaring variables, Assignment, Initiating variables, Constants, More about assignment of values, The main function, Input and output, An entry program, Formatted output, Invoice program, Time conversion program, Type conversion, The random number generator, Game program, Exercises, Selections and loops, if statement, Price calculation program, Comparison operators, Even or Odd, else if, and (&&, or (ll), Conditional input, The switch statement, Menu program, Loops, The while loop, The for loop, Addition program, Double loop, Roll Dice, Two dice roll, Breaking entry with Ctrl-Z, Pools, About the Book and the Course 11 1 Introduction to Programming 13 1.1 What Does It Mean to Program 13 1.2 Coding 15 1.3 Compiling and linking 16 1.4 The First Steps with Visual C++ 17 2 Variables 24 2.1 Introduction 24 2.2 Why Variables 24 2.3 Declaring Variables 25 2.4 Assignment 25 2.5 Initiating Variables 26 2.6 Constants 26 2.7 More about Assignment of Values 27 2.8 The main function 28 2.9 Input and Output 29 2.10 An Entry Program 31 2.11 Formatted Output 33 2.12 Invoice Program 35 2.13 Time Conversion Program 37 2.14 Type Conversion 39 2.15 The Random Number Generator 40 2.16 Game Program 41 2.17 Summary 42 2.18 Exercises 42 3 Selections and Loops 45 3.1 Introduction 45 3.2 Selection 45 3.3 if statement 45 3.4 Price Calculation Program 46 3.5 Comparison Operators 48 3.6 Even or Odd 49 3.7 else if 49 3.8 and (&&), or (||) 50 3.9 Conditional Input 51 3.10 The switch statement 52 3.11 Menu Program 52 3.12 Loops 55 3.13 The while Loop 57 3.14 The for Loop 57 3.15 Addition Program 58 3.16 Double Loop 60 3.17 Roll Dice 61 3.18 Two Dice Roll 63 3.19 Breaking Entry with Ctrl-Z 64 3.20 Pools 65 3.21 Equation 67 3.22 Interrupting a Loop - break 69 3.23 Summary 70 3.24 Exercises 70 4 Arrays 73 4.1 Introduction 73 4.2 Why Arrays 73 4.3 Declaring an Array 74 4.4 Initiating an Array 75 4.5 Copying an Array 76 4.6 Comparing Arrays 76 4.7 Average 77 4.8 Sales Statistics 80 4.9 Product File, Search 85 4.10 Two-Dimensional Array 85 4.11 Sorting 87 4.12 Searching a Sorted Array 90 4.13 Summary 94 4.14 Exercises 94 5 Strings 96 5.1 Introduction 96 5.2 Data Type char 96 5.3 Menu Program 96 5.4 Menu Program with Loop 98 5.5 Christmas Tree 100 5.6 int - char 103 5.7 Å, Ä, Ö 103 5.8 String Array, char[] 103 5.9 Length of a String 105 5.10 Upper/Lower Case 106 5.11 Initials 106 5.12 Comparing Two Strings 108 5.13 Copying Strings 109 5.14 Array with String Arrays 109 5.15 Sorting Strings 110 5.16 Substring 112 5.17 Concatenating Strings 112 5.18 Interchanging First Name and Surname 112 5.19 Encryption 115 5.20 Random Password 116 5.21 Translation Table 117 5.22 Summary 120 5.23 Exercises 120 6 Functions 123 6.1 Introduction 123 6.2 What Is a Function 123 6.3 Average 124 6.4 Calling a Function 124 6.5 Several return Statements 126 6.6 Least of Three Numbers 127 6.7 Least Item of an Array 129 6.8 Array As Parameter 130 6.9 Function and Subfunction 132 6.10 Function without Return Value 135 6.11 Replacing Characters in a String 136 6.12 Declaration Space 138 6.13 The Word Program 138 6.14 Override Functions 140 6.15 Declaration - Definition 141 6.16 Header Files 143 6.17 Reference Parameters 145 6.18 Parameters with Default Values 147 6.19 Recursive Functions 148 6.20 Summary 150 6.21 Exercises 150 7 Files 153 7.1 Introduction 153 7.2 Streams 154 7.3 Reading from a Stream 154 7.4 Writing to a Stream 155 7.5 Attaching a File to a Stream 155 7.6 A Complete Write Program 157 7.7 A Complete Reading Program 158 7.8 New Item at the End of the File 160 7.9 Products and Prices 161 7.10 Search for a Product Price 163 7.11 Sorting a File in Memory 165 7.12 Updating File Content 168 7.13 Copying Files 171 7.14 Summary 172 7.15 Exercises 172 8 Pointers 174 8.1 Introduction 174 8.2 What Is a Pointer 174 8.3 Declaring a Pointer 175 8.4 Assigning Values to Pointers 175 8.5 Addresses and char Pointers 177 8.6 cout and char Pointers 178 8.7 Price Program with Pointers 178 8.8 Pointer Arithmetics 179 8.9 Tax Program 181 8.10 Functions and Pointers 182 8.11 Dynamic Memory 186 8.12 Summary 190 8.13 Exercises 190 9 Structures 192 9.1 Introduction 192 9.2 What Is a Structure 192 9.3 Defining a Structure 192 9.4 Declaring and Initiating Structure Variables 193 9.5 Assigning Values to Structure Members 193 9.6 A Structure Program 194 9.7 Array with Structure Variables 196 9.8 Pointer to Structure 197 9.9 Structures in the Dynamic Memory 198 9.10 Structure As Function Parameter 199 9.11 Summary 206 9.12 Exercises 206 10 Answers 207 10.1 Variables 207 10.2 Selections and Loops 219 10.3 Arrays 225 10.4 Strings 229 10.5 Functions 234 10.6 Files 240 10.7 Pointers 241 10.8 Structures 245 Content 1. Introduction to Programming 1.1. What Does It Mean to Program 1.2. Coding 1.3. Compiling and linking 1.4. The First Steps with Visual C++ 2. Variables 2.1. Introduction 2.2. Why Variables 2.3. Declaring Variables 2.4. Assignment 2.5. Initiating Variables 2.6. Constants 2.7. More about Assignment of Values 2.8. The main function 2.9. Input and Output 2.10. An Entry Program 2.11. Formatted Output 2.12. Invoice Program 2.13. Time Conversion Program 2.14. Type Conversion 2.15. The Random Number Generator 2.16. Game Program 2.17. Summary 2.18. Exercises 3. Selections and Loops 3.1. Introduction 3.2. Selection 3.3. if statement 3.4. Price Calculation Program 3.5. Comparison Operators 3.6. Even or Odd 3.7. else if None 3.9. Conditional Input 3.10. The switch statement 3.11. Menu Program 3.12. Loops 3.13. The while Loop 3.14. The for Loop 3.15. Addition Program 3.16. Double Loop 3.17. Roll Dice 3.18. Two Dice Roll 3.19. Breaking Entry with Ctrl-Z 3.20. Pools 3.21. Equation 3.22. Interrupting a Loop - break 3.23. Summary 3.24. Exercises 4. Arrays 4.1. Introduction 4.2. Why Arrays 4.3. Declaring an Array 4.4. Initiating an Array 4.5. Copying an Array 4.6. Comparing Arrays 4.7. Average 4.8. Sales Statistics 4.9. Product File, Search 4.10. Two-Dimensional Array 4.11. Sorting 4.12. Searching a Sorted Array 4.13. Summary 4.14. Exercises 5. Strings 5.1. Introduction 5.2. Data Type char 5.3. Menu Program 5.4. Menu Program with Loop 5.5. Christmas Tree 5.6. int - char 5.7. Å, Ä, Ö 5.8. String Array, char[] 5.9. Length of a String 5.10. Upper/Lower Case 5.11. Initials 5.12. Comparing Two Strings 5.13. Copying Strings 5.14. Array with String Arrays 5.15. Sorting Strings 5.16. Substring 5.17. Concatenating Strings 5.18. Interchanging First Name and Surname 5.19. Encryption 5.20. Random Password 5.21. Translation Table 5.22. Summary 5.23. Exercises 6. Functions 6.1. Introduction 6.2. What Is a Function 6.3. Average 6.4. Calling a Function 6.5. Several return Statements 6.6. Least of Three Numbers 6.7. Least Item of an Array 6.8. Array As Parameter 6.9. Function and Subfunction 6.10. Function without Return Value 6.11. Replacing Characters in a String 6.12. Declaration Space 6.13. The Word Program 6.14. Override Functions 6.15. Declaration - Definition 6.16. Header Files 6.17. Reference Parameters 6.18. Parameters with Default Values 6.19. Recursive Functions 6.20. Summary 6.21. Exercises 7. Files 7.1. Introduction 7.2. Streams 7.3. Reading from a Stream 7.4. Writing to a Stream 7.5. Attaching a File to a Stream 7.6. A Complete Write Program 7.7. A Complete Reading Program 7.8. New Item at the End of the File 7.9. Products and Prices 7.10. Search for a Product Price 7.11. Sorting a File in Memory 7.12. Updating File Content 7.13. Copying Files 7.14. Summary 7.15. Exercises 8. Pointers 8.1. Introduction 8.2. What Is a Pointer 8.3. Declaring a Pointer 8.4. Assigning Values to Pointers 8.5. Addresses and char Pointers 8.6. cout and char Pointers 8.7. Price Program with Pointers 8.8. Pointer Arithmetics 8.9. Tax Program 8.10. Functions and Pointers 8.11. Dynamic Memory 8.12. Summary 8.13. Exercises 9. Structures 9.1. Introduction 9.2. What Is a Structure 9.3. Defining a Structure 9.4. Declaring and Initiating Structure Variables 9.5. Assigning Values to Structure Members 9.6. A Structure Program 9.7. Array with Structure Variables 9.8. Pointer to Structure 9.9. Structures in the Dynamic Memory 9.10. Structure As Function Parameter 9.11. Summary 9.12. Exercises 10. Answers 11. Variables 12. Selections and Loops 13. Arrays 14. Strings 15. Functions 16. Files 17. Pointers 18. Structures Sisältö Introduction to Programming What Does It Mean to Program Coding Compiling and linking The First Steps with Visual C++ Variables Introduction Why Variables Declaring Variables Assignment Initiating Variables Constants More about Assignment of Values The main function Input and Output An Entry Program Formatted Output Invoice Program Time Conversion Program Type Conversion The Random Number Generator Game Program Summary Exercises Selections and Loops Introduction Selection if statement Price Calculation Program Comparison Operators Even or Odd else if None Conditional Input The switch statement Menu Program Loops The while Loop The for Loop Addition Program Double Loop Roll Dice Two Dice Roll Breaking Entry with Ctrl-Z Pools Equation Interrupting a Loop - break Summary Exercises Arrays Introduction Why Arrays Declaring an Array Initiating an Array Copying an Array Comparing Arrays Average Sales Statistics Product File, Search Two-Dimensional Array Sorting Searching a Sorted Array Summary Exercises Strings Introduction Data Type char Menu Program Menu Program with Loop Christmas Tree int - char Å, Ä, Ö String Array, char[] Length of a String Upper/Lower Case Initials Comparing Two Strings Copying Strings Array with String Arrays Sorting Strings Substring Concatenating Strings Interchanging First Name and Surname Encryption Random Password Translation Table Summary Exercises Functions Introduction What Is a Function Average Calling a Function Several return Statements Least of Three Numbers Least Item of an Array Array As Parameter Function and Subfunction Function without Return Value Replacing Characters in a String Declaration Space The Word Program Override Functions Declaration - Definition Header Files Reference Parameters Parameters with Default Values Recursive Functions Summary Exercises Files Introduction Streams Reading from a Stream Writing to a Stream Attaching a File to a Stream A Complete Write Program A Complete Reading Program New Item at the End of the File Products and Prices Search for a Product Price Sorting a File in Memory Updating File Content Copying Files Summary Exercises Pointers Introduction What Is a Pointer Declaring a Pointer Assigning Values to Pointers Addresses and char Pointers cout and char Pointers Price Program with Pointers Pointer Arithmetics Tax Program Functions and Pointers Dynamic Memory Summary Exercises Structures Introduction What Is a Structure Defining a Structure Declaring and Initiating Structure Variables Assigning Values to Structure Members A Structure Program Array with Structure Variables Pointer to Structure Structures in the Dynamic Memory Structure As Function Parameter Summary Exercises Answers Variables Selections and Loops Arrays Strings Functions Files Pointers Structures Obsah Introduction to Programming What Does It Mean to Program Coding Compiling and linking The First Steps with Visual C++ Variables Introduction Why Variables Declaring Variables Assignment Initiating Variables Constants More about Assignment of Values The main function Input and Output An Entry Program Formatted Output Invoice Program Time Conversion Program Type Conversion The Random Number Generator Game Program Summary Exercises Selections and Loops Introduction Selection if statement Price Calculation Program Comparison Operators Even or Odd else if None Conditional Input The switch statement Menu Program Loops The while Loop The for Loop Addition Program Double Loop Roll Dice Two Dice Roll Breaking Entry with Ctrl-Z Pools Equation Interrupting a Loop - break Summary Exercises Arrays Introduction Why Arrays Declaring an Array Initiating an Array Copying an Array Comparing Arrays Average Sales Statistics Product File, Search Two-Dimensional Array Sorting Searching a Sorted Array Summary Exercises Strings Introduction Data Type char Menu Program Menu Program with Loop Christmas Tree int - char Å, Ä, Ö String Array, char[] Length of a String Upper/Lower Case Initials Comparing Two Strings Copying Strings Array with String Arrays Sorting Strings Substring Concatenating Strings Interchanging First Name and Surname Encryption Random Password Translation Table Summary Exercises Functions Introduction What Is a Function Average Calling a Function Several return Statements Least of Three Numbers Least Item of an Array Array As Parameter Function and Subfunction Function without Return Value Replacing Characters in a String Declaration Space The Word Program Override Functions Declaration - Definition Header Files Reference Parameters Parameters with Default Values Recursive Functions Summary Exercises Files Introduction Streams Reading from a Stream Writing to a Stream Attaching a File to a Stream A Complete Write Program A Complete Reading Program New Item at the End of the File Products and Prices Search for a Product Price Sorting a File in Memory Updating File Content Copying Files Summary Exercises Pointers Introduction What Is a Pointer Declaring a Pointer Assigning Values to Pointers Addresses and char Pointers cout and char Pointers Price Program with Pointers Pointer Arithmetics Tax Program Functions and Pointers Dynamic Memory Summary Exercises Structures Introduction What Is a Structure Defining a Structure Declaring and Initiating Structure Variables Assigning Values to Structure Members A Structure Program Array with Structure Variables Pointer to Structure Structures in the Dynamic Memory Structure As Function Parameter Summary Exercises Answers Variables Selections and Loops Arrays Strings Functions Files Pointers Structures Structured Programming with C++ is intended as course material for the course Structured Programming with C/C++ at university level. It can also be used as self-learning material. You can download the book for free via the link below.
دانلود کتاب Structured Programming with C++