CS501 · Syllabus
A first course in programming using C++. Covers fundamentals from the machine model and basic syntax through control flow, functions, recursion, arrays, strings, structures and file handling.
Course
CS501
Lectures
27
Language
C++
An introduction to programming — instructions, execution, language processors, and the basic structure of a C++ program.
History of C++, the problem-solving phase, pseudocode, and how flowcharts visualize algorithms.
Classifications of programming languages — machine, low-level, high-level — and how compilers, interpreters and assemblers differ.
Program development process, IDE compilation steps, C++ reserved words, and the full primitive data type hierarchy.
Identifiers, primitive types, assignment, I/O via cin/cout, type compatibility, and boolean expressions.
Operator precedence, named constants, increment / decrement, augmented assignment, and the compilation lifecycle.
Simple if, if-else, blocks, multi-way else-if ladders, and the bool data type in conditions.
Nested if statements, the ternary operator, and the switch statement for clean multi-branch selection.
Counter-controlled repetition with the for loop, plus break and continue for altering control flow inside loops.
The while loop — a pretest, condition-controlled loop that runs zero or more times based on a test expression.
Using rand(), RAND_MAX, and srand() to generate random integers — plus formulas for bounded ranges.
A posttest loop that always executes at least once — ideal for input validation and menu-driven programs.
Placing one loop inside another — used for tables, patterns, and multi-dimensional iteration.
A single name for many values of the same type, stored in contiguous memory and accessed by an integer index.
Copying, two-dimensional arrays of rows and columns, and the classic search / max / count patterns.
Breaking programs into reusable building blocks: defining functions, calling them, parameters, return values, and prototypes.
Advantages of functions, library vs user-defined, the three components, parameter lists, and return statements.
Four function shapes by return type and arguments, pass-by-value, and the scope/lifetime of local, global, and static variables.
Default arguments, function overloading, ambiguous invocation, and inline functions.
Passing arguments by address using pointers so a function can modify the caller's variables; plus passing 1D and 2D arrays.
Functions that call themselves — elegant solutions for problems naturally defined in terms of smaller subproblems.
Storing text as null-terminated character arrays — declaration, initialization, input with cin / getline, and 2D arrays of strings.
User-defined types that bundle several related values of different types into one record.
Arrays whose elements are structs — for storing many records — and structures that contain other structures as members.
Reading from and writing to files on disk using fstream, ifstream and ofstream — the persistent twin of cin and cout.
Get / put pointers, seekg / seekp, binary file I/O with read() and write(), and the difference between text and binary modes.
Improving the structure of existing code without changing its behavior — seven practical techniques every engineer should know.