APCS: C++ Programming


Location: 德田館 Room 223B
Time: 14:00 ~ 17:00


``What I cannot create, I do not understand.''
-- Richard Feynman

``Talk is cheap. Show me the code.''
-- Linus Torvalds

``Either run for food, or run from being food.''
-- Jen-Hsun "Jensen" Huang

Instructor Information

Wifi Access

Software Installation

Make-up Class Method Students are advised to utilize the website NTU COOL for class compensation. Please note, the required login credentials are those associated with your individual training class account.

Recording Classroom Lectures Policy Recording of classroom lectures is prohibited unless advance written permission is obtained from the class instructor and any guest presenter(s).

Objectives

Prerequisites

Topics (tentative)

Schedule [ 270, 272, 285, 287, 300, 302, 309, 314, 316, 324, 325, 327, 331, 332, 333, 338, 339, 362, 363, 378, 389, 393, 403, 412, 414, 435, 442 ]

Date Key Concepts
2025.6.23 ch.0 code
2025.6.24 ch.1 ch.2 code
  • Data types, variables, operators (cont'd)
    • Data types: string, bool
    • Basic operators: arithmetic (+-*/%), assignment (=), compound arithmetic operators (+=, -=, *=, /=, ++, --)
    • (FYR) Michael Lewin, All About XOR, 2012
  • Flow controls
    • Branching: if-else with relational & logical operators
2025.6.25 code
  • Flow controls (cont'd)
    • Branching: switch-case-default-break, A ? B : C
    • Repetitions: while loops, do-while loops
    • Repetitions: for loops
    • Loop examples: sum over 1 ... 100, GCD, play dices by using random integers, compounding, Monte Carlo simulation for π, binary search
    • Jump statements (break, continue)
2025.6.26 ch.3 code
  • Flow controls (cont'd)
    • Nested loops
    • Analysis of algorithms
  • Data structures & algorithms
    • Arrays
    • Zero-based indexing: Why starting from 0?
    • Descriptive statistics: max, min, sum, mean, and standard deviation
    • Sorting: bubble sort, selection sort, insertion sort
2025.6.27 ch.4 code
  • Data structures & algorithms (cont'd)
    • Random permutation: shuffling
    • char arrays and C++ strings
    • 2D arrays
  • Functions
    • User-defined function
    • Call stack & variable scope
    • Function overloading
    • Special issue: int main(int argc, char** argv)
2025.6.30 ch.5 code
  • Functions (cont'd)
    • Recursion: factorial, sum, gcd, Fibonacci numbers
  • Pointers
    • Syntax & concepts
    • Pass by address: swap
    • Pointer vs. array
    • Dynamic memory allocation: heap, new / delete
    • 2D arrays (static vs. dynamic)
    • Function pointer
    • typedef: alias for your own need
    • Constant pointers
2025.7.1 ch.6 code
  • C++ syntaxes: reference, auto
  • Structures
  • Linked list
  • Binary tree
  • Preprocessor, compilation, and linking
  • Debugger: gdb
2025.7.2 TBA
code
2025.7.3 TBA
code
    TBA
2025.7.4
Promotion

Gradebook

References

C++

C

Data structures and algorithms

Computer architecture

AP Computer Science related

Online judge systems

Misc

Additional reading