Table of Contents
1. Introduction
1.1 Programming (general)
1.2 Programming basics
1.3 Comments and whitespace
1.4 Brief history
1.5 Computers all around us
1.6 Representing information as bits
1.7 Problem solving
1.8 Why programming
1.9 Why whitespace matters
1.10 Code and pseudocode
2. Variables / Assignments
2.1 Variables and assignments (general)
2.2 Variables (integer)
2.3 Identifiers
2.4 Arithmetic expressions (general)
2.5 Arithmetic expressions (integer)
2.6 Example: Health data
2.7 Floating-point numbers (float)
2.8 Using math functions
2.9 Random numbers
2.10 Integer division
2.11 Type conversions
2.12 Modulo operator
2.13 Data types
2.14 Constants
2.15 Code: Variables and assignments
3. Branches
3.1 Branches
3.2 More branches
3.3 Equality and relational operators
3.4 Detecting ranges using branches
3.5 Logical operators
3.6 Order of evaluation
3.7 Example: Toll calculation
3.8 Floating-point comparison
3.9 Code: Branches
3.10 Code: More branches
4. Loops
4.1 Loops (general)
4.2 Loop basics
4.3 More loop examples
4.4 Looping N times
4.5 Loop examples iterating N times
4.6 While and for loops
4.7 Nested loops
4.8 Code: While loops
4.9 Code: For loops
5. Arrays
5.1 Array concept (general)
5.2 Arrays
5.3 Array iteration drill
5.4 Iterating through arrays
5.5 Swapping two variables (general)
5.6 Code: Arrays
6. User-Defined Functions
6. User-Defined Functions
6.1 User-defined function basics
6.2 Return
6.3 Reasons for defining functions
6.4 Functions with branches/loops
6.5 Code: Functions
6.6 Code: Functions with array parameters
7. Software Topics
7.1 Algorithms
7.2 Language survey
7.3 Libraries
8. Troubleshooting Process
8.1 Troubleshooting: Hypotheses and tests
8.2 Logic of troubleshooting
8.3 Creating hypotheses
8.4 Ex: Dog whimpering
8.5 Troubleshooting game
8.6 Knowledge
8.7 Ex: iPhone headset
8.8 Ex: USB car charger
8.9 Ex: Gmail username
8.10 Hierarchical hypotheses
9. Program Debugging
9.1 Basic debugging
9.2 Ex: Calculation error
9.3 Ex: Logic error
9.4 Ex: Loop error
9.5 Ex: Function error
9.6 Programming knowledge
10. Algorithms
10.1 Introduction to algorithms
10.2 Algorithm efficiency
10.3 Searching and algorithms
10.4 Binary search
10.5 Sorting: Introduction
10.6 Heuristics
What You’ll Find In This zyBook:
More action with less text.
- Provides an exceptionally approachable introduction to programming concepts.
- Initially uses flowcharts to teach basic programming concepts including variables, data types, assignment statements, arithmetic operations, decisions, loops, arrays, and functions. For each, also teaches coding.
- Uses a new ultra-simple programming language, Coral, having unified flowchart and code version, and coming with a free web-based educational simulator.
- Also introduces basic troubleshooting/debugging techniques, and overviews program design methods including waterfall and agile design processes, UML, libraries, and more.
- zyLabs save time through auto-grading and prevent cheating with coding trails and submission similarity checks.
- New! 34 zyBooks-maintained labs for Coral with an integrated simulator.
- With Test Banks.
The zyBooks Approach
Less text doesn’t mean less learning.
Many teachers realize that students in introductory programming courses not only have to learn fundamental programming concepts, but also have to learn non-ideal detailed syntax and semantics of a specific industry programming language. An alternative approach, used in this zyBook, is to first teach programming concepts in a language-neutral manner, thereby enabling students to master those concepts before having to learn details of a specific programming language. This material teaches programming using a flowchart language, which is more approachable yet maintains the precision of a programming language (and is executable so is fun). The material also teaches how to convert a flowchart to a simple code language, enabling a gradual learning path from flowcharts to code to an industry programming language.
The zyBook contains animations of most concepts, helping readers to “see” the concepts and build an intuitive understanding. The zyBook also makes extensive use of our web-based educational simulator, so that nearly every example can be run by the student.
Authors
Roman Lysecky
Professor of Electrical and Computer Engineering, Univ. of Arizona
Frank Vahid
Professor of Computer Science and Engineering, Univ. of California, Riverside
Contributors
Alex Edgcomb
Senior Software Developer at zyBooks
Arián Jiménez
Software Developer at zyBooks
Susan Lysecky
Senior Content Developer at zyBooks
Evan Olds
Content Developer at zyBooks
Nkenge Wheatland
Content Developer at zyBooks