Programming Fundamentals and OOP Cheat Sheet
MEGA CHEAT SHEET
1. Programming Fundamentals
Software Development Life Cycle (SDLC)
Steps: Requirements → Specifications → Design → Development → Integration → Testing/Debugging → Installation → Maintenance.
Mnemonic: Really Smart Developers In Tech Install Machines.
Algorithms
- Control Structures:
- Sequence (In Order)
- Selection (If/Else)
- Iteration (Loops)
- Design Strategies: Divide and Conquer, Backtracking.
- Representations: Pseudocode, Flowcharts, Structure Charts, Abstraction Diagrams.
- Checking: Identify Input/Output, Purpose, Desk Check with data.
Programming Paradigms
- Imperative: Step-by-step instructions (e.g., Python).
- OOP: Objects and classes (e.g., Java, Python).
- Logic: Facts and rules (e.g., Prolog).
- Functional: Pure functions, no state (e.g., Haskell).
Data Representation
- Number Systems: Binary (Base 2), Decimal (Base 10), Hexadecimal (Base 16).
- Two's Complement: Represents negative numbers.
- Data Types: Char, String, Boolean, Real/Float, Integer, Date/Time.
Data Structures
- Arrays (1D/2D), Lists, Trees, Stacks, Hash Tables, Records, Sequential Files.
Debugging Techniques
- Tools: Breakpoints, Step-through, Watches, Debug Output.
- Errors:
- Syntax (Grammar mistake).
- Logic (Wrong algorithm).
- Runtime (Crash at execution).
Software Testing
- Test Data: Boundary values, Path coverage, Faulty/Abnormal data.
- Models: Waterfall (Rigid, Structured) vs. Agile (Flexible, Iterative).
2. Object-Oriented Paradigm (20 Marks)
Key OOP Principles
- Objects: Instances of classes.
- Classes: Blueprints for objects.
- Encapsulation: Hide internal data, expose only methods.
- Abstraction: Show essential details only.
- Inheritance: Child inherits from parent.
- Generalization: Common traits grouped into a superclass.
- Polymorphism: Same method, different behavior across classes.
Procedural vs. OOP
- Procedural: Function-based, linear (e.g., C).
- OOP: Object-based, modular, reusable (e.g., Python, Java).
Design Tools
- Diagrams:
- Data Flow Diagram (DFD): Shows data movement.
- Structure Chart: Module breakdown.
- Class Diagram: Attributes, methods, and relationships.
Code Practices
- Clean mainline code.
- One logical task per subroutine.
- Use stubs for incomplete methods.
- Version control and commenting.
Testing Methodologies
- Unit: Single component.
- Subsystem: Module level.
- System: Full program.
- Black Box: External inputs/outputs.
- White Box: Internal logic.
- Grey Box: Mix of both.
English with a size of 3.49 KB