Skip to index filter Skip to main content
CISC 192 textbook home CISC 192 TextbookCISC 192 Textbook
  • on GitHub
Search the documentation

CISC 192 Textbook

  • on GitHub

  • Change appearance
    • Change appearance
    • Light
    • Dark
    • Automatic
  Index
Index

Legal and foreword

  • Copyright Notice
  • License
  • Foreword
  • Preface
  • 1. The way of the program
    • 1.1. The Way of the Program
    • 1.2. What is a Programming Language?
    • 1.3. What is a Program?
    • 1.4. What is Debugging?
    • 1.5. Formal and Natural Languages
    • 1.6. The First Program
    • 1.7. Glossary
    • 1.8. Multiple Choice Exercises
  • 2. Variables and types
    • 2.1. More Output
    • 2.2. Values
    • 2.3. Variables
    • 2.4. Assignment
    • 2.5. Constants
    • 2.6. Outputting Variables
    • 2.7. Keywords
    • 2.8. Operators
    • 2.9. The Modulus Operator
    • 2.10. Order of Operations
    • 2.11. Operators for Characters
    • 2.12. Compound Expressions
    • 2.13. Glossary
    • 2.14. Multiple Choice Exercises
    • 2.15. Mixed-Up Code Exercises
    • 2.16. Activecode Exercises
  • 3. Functions
    • 3.1. Floating-point
    • 3.2. Converting from double to int
    • 3.3. Math Functions
    • 3.4. Composition
    • 3.5. Adding New Functions
    • 3.6. Definitions and Uses
    • 3.7. Namespaces
    • 3.8. Prefer using declarations to using namespace std
    • 3.9. Programs with Multiple Functions
    • 3.10. Parameters and Arguments
    • 3.11. Parameters and Variables are Local
    • 3.12. Functions with Multiple Parameters
    • 3.13. Functions with Results
    • 3.14. Glossary
    • 3.15. Multiple Choice Exercises
    • 3.16. Mixed-Up Code Exercises
    • 3.17. Activecode Exercises
  • 4. Fruitful functions
    • 4.1. Fruitful functions
    • 4.2. Conditional Execution
    • 4.3. Alternative Execution
    • 4.4. Chained Conditionals
    • 4.5. Nested Conditionals
    • 4.6. The return keyword
    • 4.7. Returning early
    • 4.8. Returning from main
    • 4.9. Program Development
    • 4.10. Function Composition
    • 4.11. Overloading
    • 4.12. Boolean Values
    • 4.13. Boolean Variables
    • 4.14. Logical operators
    • 4.15. Bool Functions
    • 4.16. Glossary
    • 4.17. Multiple Choice Exercises
    • 4.18. Mixed Up Code Practice
    • 4.19. Coding Practice
  • 5. Iteration
    • 5.1. Multiple assignment
    • 5.2. Iteration
    • 5.3. The while statement
    • 5.4. Tables
    • 5.5. Two-dimensional tables
    • 5.6. The for statement
    • 5.7. Encapsulation and generalization
    • 5.8. Functions
    • 5.9. More encapsulation
    • 5.10. Local variables
    • 5.11. More generalization
    • 5.12. Glossary
    • 5.13. Multiple Choice Exercises
    • 5.14. Mixed Up Code Practice
    • 5.15. Coding Practice
  • 6. Recursion
    • 6.1. Recursion
    • 6.2. Infinite Recursion
    • 6.3. Stack Diagrams for Recursive Functions
    • 6.4. More recursion
    • 6.5. One more example
    • 6.6. Glossary
    • 6.7. Multiple Choice Exercises
    • 6.8. Mixed-Up Code Exercises
    • 6.9. Activecode Exercises
  • 7. Strings and things
    • 7.1. Containers for strings
    • 7.2. string variables
    • 7.3. Extracting characters from a string
    • 7.4. String size
    • 7.5. Traversal
    • 7.6. A run-time error
    • 7.7. The find function
    • 7.8. Our own version of find
    • 7.9. Looping and counting
    • 7.10. Increment and decrement operators
    • 7.11. String concatenation
    • 7.12. strings are mutable
    • 7.13. strings are comparable
    • 7.14. Character classification
    • 7.15. Other string functions
    • 7.16. Glossary
    • 7.17. Multiple Choice Exercises
    • 7.18. Mixed Up Code Practice
    • 7.19. Coding Practice
  • 8. Structures
    • 8.1. Compound values
    • 8.2. point objects
    • 8.3. Accessing instance variables
    • 8.4. Operations on structures
    • 8.5. Structures as parameters
    • 8.6. Pass by value
    • 8.7. Pass by reference
    • 8.8. Rectangles
    • 8.9. Structures as return types
    • 8.10. Passing other types by reference
    • 8.11. Getting user input
    • 8.12. Glossary
    • 8.13. Multiple Choice Exercises
    • 8.14. Mixed Up Code Practice
    • 8.15. Coding Practice
  • 9. More Structures
    • 9.1. time
    • 9.2. Functions for objects
    • 9.3. Pure functions
    • 9.4. const parameters
    • 9.5. Modifiers
    • 9.6. Fill-in functions
    • 9.7. Which is best?
    • 9.8. Incremental development versus planning
    • 9.9. Generalization
    • 9.10. Algorithms
    • 9.11. Glossary
    • 9.12. Multiple Choice Exercises
    • 9.13. Mixed Up Code Practice
    • 9.14. Coding Practice
  • 10. Vectors
    • 10.1. Vectors
    • 10.2. Accessing elements
    • 10.3. Copying vectors
    • 10.4. Vector size
    • 10.5. Vector functions
    • 10.6. Glossary
    • 10.7. Multiple Choice Exercises
    • 10.8. Mixed-Up Code Exercises
    • 10.9. Activecode Exercises
  • 11. Random numbers
    • 11.1. Random numbers
    • 11.2. Statistics
    • 11.3. Vector of random numbers
    • 11.4. Counting
    • 11.5. Checking the other values
    • 11.6. A histogram
    • 11.7. A single-pass solution
    • 11.8. Permutations
    • 11.9. Glossary
    • 11.10. Multiple Choice Exercises
    • 11.11. Mixed-Up Code Exercises
    • 11.12. Activecode Exercises
  • 12. Vectors of Objects
    • 12.1. Composition
    • 12.2. playing_card objects
    • 12.3. The print_card function
    • 12.4. The equals function
    • 12.5. The is_greater function
    • 12.6. Vectors of cards
    • 12.7. The print_deck function
    • 12.8. Searching
    • 12.9. Bisection search
    • 12.10. Decks and subdecks
    • 12.11. Glossary
    • 12.12. Multiple Choice Exercises
    • 12.13. Mixed-Up Code Exercises
    • 12.14. Coding Practice
  • 13. Objects of Vectors
    • 13.1. Enumerated types
    • 13.2. switch statement
    • 13.3. Decks
    • 13.4. Another constructor
    • 13.5. card_deck member functions
    • 13.6. Shuffling
    • 13.7. Sorting
    • 13.8. Subdecks
    • 13.9. Shuffling and dealing
    • 13.10. Mergesort
    • 13.11. Glossary
    • 13.12. Multiple Choice Exercises
    • 13.13. Mixed-Up Code Exercises
    • 13.14. Coding Practice
  • 14. Classes and invariants
    • 14.1. Private data and classes
    • 14.2. What is a class?
    • 14.3. complex_number numbers
    • 14.4. Accessor functions
    • 14.5. Output
    • 14.6. A function on complex_number numbers
    • 14.7. Another function on complex_number numbers
    • 14.8. Invariants
    • 14.9. Preconditions
    • 14.10. Private functions
    • 14.11. Glossary
    • 14.12. Multiple Choice Exercises
    • 14.13. Mixed-Up Code Exercises
    • 14.14. Coding Practice
  • 15. Files and standard-library containers
    • 15.1. From files to containers
    • 15.2. Streams
    • 15.3. File input
    • 15.4. File output
    • 15.5. Parsing quoted records
    • 15.6. Parsing numbers with error reporting
    • 15.7. Fixed-size sequences with std::array
    • 15.8. Growing sequences with std::vector
    • 15.9. Unique values with std::set
    • 15.10. Key-value associations with std::map
    • 15.11. A distance table with maps and sets
    • 15.12. Glossary
    • 15.13. Multiple Choice Exercises
    • 15.14. Mixed-Up Code Exercises
    • 15.15. Coding Practice
    • 15.16. Files used in the practice
  1. Start
  2. Copyright Notice

Copyright NoticeΒΆ

Copyright (C) Barbara Ericson and Allen B. Downey.
This ebook in an interactive version of the How to Think Like a Computer
Scientist: C++ Version by Allen Downey at
https://open.umn.edu/opentextbooks/textbooks/how-to-think-like-a-computer-scientist-c-version

Unless otherwise noted, all content in this work is licensed as follows.

CC-BY-NC

Creative Commons License
CISC 192 Reader by Dave Parillo, Barbara Ericson, and Allen B. Downey. is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.
Based on the work How to Think Like a Computer Scientist, C++ Edition.
Permissions beyond the scope of this license may be available at Runestone Academy.

This is a human-readable summary of (and not a substitute for) the license.

You are free to:

Share -- copy and redistribute the material in any medium or format

Adapt -- remix, transform, and build upon the material

The licensor cannot revoke these freedoms as long as you follow the license terms.


Under the following terms:

Attribution -- You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.

NonCommercial -- You may not use the material for commercial purposes.

No additional restrictions -- You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.


Notices:

You do not have to comply with the license for elements of the material in the public domain or where your use is permitted by an applicable exception or limitation.

No warranties are given. The license may not give you all of the permissions necessary for your intended use. For example, other rights such as publicity, privacy, or moral rights may limit how you use the material.

See license for the full license text.

  On this page
  • Copyright Notice
  • Previous CISC 192 Course Reader
  • Next License
CISC 192 Textbook
  • 2017-2026 Dave Parillo
Built with Sphinx 9.1.0 and Nefertiti 0.9.9