APCS: C++ Programming


Location: 德田館 Room 219
Time: 09:00 ~ 12:45 & 13:45 ~ 17:30


``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

Installation & Wifi

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 ]

Date Key Concepts
2025.2.4 ch.0 ch.1 ch.2 code
2025.2.5 code
  • Flow controls (cont'd)
    • Branching (switch-case-default-break, A?B:C)
    • Loops (while, do-while, for)
    • Some algorithms
      • Simple sum: 1 ~ 100
      • Greatest common divisor
      • Random integers
      • Compounding
      • Monte Carlo simulation for π
      • Binary search
    • Jump statements (break, continue)
    • Nested loops
2025.2.6 ch.3 ch.4 code
  • Flow controls (cont'd)
    • 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
    • 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)
    • Recursion: factorial
2025.2.7 ch.5 ch.6 code
  • Functions (cont'd)
    • Recursion: 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
  • C++ syntaxes: reference, auto
  • Structures
  • Linked list & binary tree
  • Preprocessor, compilation, and linking
  • Debugger: gdb
  • APCS 近年考題清單
  • Take-home-message
Promotion

Gradebook

References

C++

C

Data structures and algorithms

Computer architecture

AP Computer Science related

Online judge systems

Misc

Additional reading