Programming for Problem Solving (PPS)
Unit 1 – Introduction to Programming (Notes)
1.1 Computers Basics
• Computer: An electronic machine that processes data into information according to
instructions.
• Components of Computer System:
• 1. Input Unit – Keyboard, mouse, mic, scanner.
• 2. Output Unit – Monitor, printer, speakers.
• 3. Memory Unit – Primary (RAM, ROM), Secondary (HDD, SSD).
• 4. ALU – Arithmetic & Logic operations.
• 5. Control Unit – Fetch, Decode, Execute, Write-back (Machine Cycle).
• 6. CPU = ALU + CU + Memory. Peripherals = Input & Output devices.
1.2 Hardware vs Software
• Hardware: Physical components (CPU, Monitor, Mouse).
• Software: Set of programs driving hardware.
• → System Software: OS, Compilers, Translators.
• → Application Software: Word, Excel, Tally, Games.
• → Utility Software: Antivirus, Compression tools.
1.3 Operating System
• Acts as resource manager of CPU, memory, I/O devices.
• Provides interface between user & hardware.
• Examples: Windows, Linux, Unix, Solaris, BOSS, Android, iOS.
1.4 Language Translators
• Assembler – Assembly → Machine code.
• Compiler – Translates whole program, produces object code.
• Interpreter – Line by line execution, slower but useful for debugging.
1.5 Programming Environment
• Includes Editor, Compiler, Linker, Loader, Debugger.
• IDEs: Turbo C/C++, CodeBlocks, Visual Studio, Eclipse.
1.6 Booting Process
• Cold Booting: Start from OFF state (full POST).
• Warm Booting: Restart (Ctrl+Alt+Del).
• Steps: Power on → BIOS POST → Bootloader → OS loaded.
1.7 Algorithms
• Definition: Step-by-step procedure to solve problem.
• Characteristics: Input, Output, Definiteness, Finiteness, Effectiveness.
• Representation: Flowchart (symbols), Pseudocode (English-like steps).
1.8 From Algorithm to Program
• Steps: Algorithm → Flowchart/Pseudocode → C Program → Compilation → Execution.
• Structure of C program: Preprocessor → main() → Declarations → Statements → Return.
1.9 C Language Basics
• Features: Mid-level, portable, efficient, structured.
• Applications: OS development, Compilers, Embedded systems.
• Building Blocks: Character set, Tokens, Data types, Variables, Constants, Expressions,
Statements, I/O.
1.10 Example Problems
• Even/Odd check.
• Largest of 3 numbers.
• Grade assignment (A+, A, B, C, D, F).
• Commission calculation based on sales.
• Palindrome, Armstrong, Prime number check.
• Fibonacci sequence generation.
Unit Summary (Exam Pointers)
• IPO cycle, CPU components.
• Hardware vs Software.
• OS roles, Booting process.
• Algorithm → Flowchart → Pseudocode.
• Structure of C program, Tokens, Data types, I/O.
• Common example problems.