■ PROGRAMMING FUNDAMENTALS — MIDTERM COMPLETE NOTES
■ WEEK 1 — INTRODUCTION
1. Introduction to Computer Computer: an electronic device that takes input, processes it,
and gives output. Main Components: 1. Input Unit: keyboard, mouse 2. Output Unit:
monitor, printer 3. Memory Unit: RAM, ROM 4. CPU: performs all processing
Computer Software: - System Software – Operating systems, compilers, interpreters. -
Application Software – Word, Excel, games.
Types of Computer Languages: Machine Language - Binary (0,1) - Directly understood by
computer Assembly Language - MOV A, B - Uses mnemonics High Level Language -
C++, Java, Python - Easy for humans to read
2. Introduction to Programming Programming: the process of writing instructions for the
computer to perform tasks.
Program Life Cycle: 1. Problem Definition 2. Design (Algorithm/Flowchart) 3. Coding 4.
Testing 5. Execution
Steps to create a C++ program: 1. Write code (.cpp) 2. Compile (check errors) 3. Link
(connect libraries) 4. Execute (run the program)
■ WEEK 2 — PROBLEM SOLVING
3. Problem Solving Process Software Development Method: 1. Problem Definition 2.
Analysis: identify inputs, process, and outputs 3. Algorithm Design 4. Flowchart 5. Coding
6. Testing & Debugging 7. Documentation
4. Algorithm & Flowchart Algorithm: step-by-step method to solve a problem. Example:
Add two numbers 1. Start 2. Input a, b 3. sum = a + b 4. Display sum 5. End
Flowchart Symbols: Start / End, Process (calculation), Decision (if, condition), Input /
Output
■ WEEK 3 — GETTING STARTED WITH C++
5. Structure of a C++ Program #include using namespace std; int main() { cout << "Hello
World"; return 0; }
Parts of a C++ Program: Preprocessor directive, Main function, Statements, Semicolon (;)
6. The C++ Character Set Letters: A–Z, a–z Digits: 0–9 Symbols: +, -, *, /, =, {, }, (, ), ;
White spaces: space, tab, newline
7. Constants, Variables, and Keywords Keywords: reserved words (cannot be used as
names) Identifiers: names given to variables and functions Constants: fixed values that
never change Variables: data that can change during program
■ WEEK 4 — DATA TYPES AND INPUT/OUTPUT
8. Data Types int, float, double, char, bool Type Casting: converting one type to another
9. Standard Input/Output #include using namespace std; int main() { int num; cout <<
"Enter a number: "; cin >> num; cout << "You entered: " << num; }
■ WEEK 5 — OPERATORS
10. Operators in C++ Arithmetic: + - * / % Relational: < > <= >= == != Logical: && || !
Assignment: = += -= *= /= Increment/Decrement: ++ --