Class Orientation & Fundamentals of Programming – Comprehensive Notes

National University – Institutional Context

  • Vision: NU is a dynamic private institution committed to nation-building and internationally recognized for education and research.
  • Mission: Guided by Dynamic Filipinism and the core values, NU is committed to providing relevant, innovative, accessible, quality education and development programs.
  • Core Values (School of Engineering, Computing & Architecture)
    • Patriotism • Compassion • Innovation • Integrity • Resilience
  • Stakeholder Commitments
    • Students – formation of life-long learners, ethical & spiritual citizens, self-directed change agents.
    • Faculty & Employees – competency enhancement, passion cultivation, just & fulfilling work environment.
    • Alumni – pride, engagement, and loyalty to alma mater.
    • Industry Partners & Employers – active collaboration; supply of graduates who spur growth.
    • Community – improved living conditions and well-being.
  • GAINs (Graduate Attributes Intended for Nationalians)
    • Leadership & Teamwork • Responsible Citizenship • Innovative, Creative & Critical Thinking
    • Academic & Professional Competence • Effective Communication • Whole-Person Character • Life & Career Skills Orientation

Course Mechanics – Fundamentals of Programming

Assessment Breakdown
  • Long Examinations – 40 %
  • Class Standing – 20 % (≥ 3 major quizzes/term, assignments, seat-work/lab, recitation)
  • Periodic Departmental Exams – 40 % (Midterm & Final)
Grade Computations
  • Midterm: Midterm Grade=0.30(Lab)+0.30(Class Standing)+0.40(Periodic Exam)\text{Midterm Grade}=0.30\,(\text{Lab})+0.30\,(\text{Class Standing})+0.40\,(\text{Periodic Exam})
  • Final Period: Final Grade Period=0.15(Lab)+0.30(Class Standing)+0.15(Project)+0.40(Periodic Exam)\text{Final Grade Period}=0.15\,(\text{Lab})+0.30\,(\text{Class Standing})+0.15\,(\text{Project})+0.40\,(\text{Periodic Exam})
  • Overall Course Grade: Final Course Grade=0.50(Midterm)+0.50(Final Period)\text{Final Course Grade}=0.50\,(\text{Midterm})+0.50\,(\text{Final Period})
  • Descriptive Equivalents
    961004.00  (R:Repeat)96\text{–}100 \Rightarrow 4.00\;(R:Repeat)91953.50  (Failure)91\text{–}95 \Rightarrow 3.50\;(Failure)
    87903.0087\text{–}90 \Rightarrow 3.0084862.5084\text{–}86 \Rightarrow 2.5081832.0081\text{–}83 \Rightarrow 2.0078801.5078\text{–}80 \Rightarrow 1.5075771.0075\text{–}77 \Rightarrow 1.00
    • Special marks: 0.00  (Cheating),  Dr  (Dropped),  Inc  (Incomplete)0.00\;(Cheating),\;Dr\;(Dropped),\;Inc\;(Incomplete)

Systems & Software Foundations

What Is a System?
  • Organized set of inter-related components (software, hardware, procedures).
  • Receives inputs → processes data → produces outputs to accomplish a task/solve a problem.
  • Programming perspective:
    • Input layer (user data, sensors, files). • Processing logic (algorithms, conditions, loops).
    • Output layer (screens, printers, files, APIs).
    • Additional pieces: code modules, data structures, UI, interaction flows.
  • Real-world example: Fast-food order system (take order → assemble food → collect payment).
System Development Life Cycle (SDLC)
  1. Preliminary Investigation – define the problem.
  2. Analysis – study existing system; gather & analyse data; develop requirements.
  3. Design – preliminary & detailed planning of new system.
  4. Development – scheduling, programming, unit testing.
  5. Implementation – training, conversion, evaluation, maintenance.

Programming & Problem-Solving Workflow

  1. Understand the Problem – clarify vague requirements; act as counselor/detective.
  2. Plan the Logic (Algorithm Design) – use flowcharts or pseudocode; ignore syntax.
  3. Code the Program – choose a language (C, C++, Java, VB, COBOL, etc.); focus on correct syntax.
  4. Compile – translator converts high-level source to machine code (0s & 1s); catches syntax errors.
  5. Test – execute with varied data; identify syntactical vs. logical, compile-time vs. run-time errors.
  6. Production – deploy, train users, run with live data, obtain user approval.

Algorithms

  • Definition: Finite sequence of clear, unambiguous steps that produces the correct output and halts.
  • Human-level analogies: baking a cake, navigating to a destination, computing income tax.
  • Example: “Prepare a cup of coffee” – 10 conditional & sequential steps.
  • Essential characteristics
    • Precise, unambiguous instructions • Finite number of steps • Guaranteed termination
    • At least one output/result

Flowcharting Essentials

  • Purpose: graphical blueprint of program logic; clarifies IPO (Input-Process-Output) paths.
  • Two main chart types
    • Program Flowchart – detailed internal logic.
    • System Flowchart – data flow across departments; highlights duplication & delays.
  • Common Symbols (name – meaning)
    • Oval/Pill – Start/End (Terminal) • Parallelogram – Input/Output
    • Rectangle – Process/Computation • Diamond – Decision
    • Arrow – Flow direction • Circle – On-page connector • Pentagon – Off-page connector
    • Hexagon – Initialization/Preparation
  • Conventions
    • Each statement in its own symbol box. • Input usually in a parallelogram with English statement.
Advantages
  1. Improved communication among stakeholders.
  2. More effective analysis & debugging support.
  3. Serves as permanent documentation.
  4. Facilitates efficient coding & maintenance.
Limitations
  1. Becomes clumsy with complex logic.
  2. Any change may require redrawing.
  3. Hard to reproduce with standard typing tools.
  4. Risk of losing the ‘what’ by focusing on low-level ‘how.’

Data Elements in Programming

Variables
  • Memory locations whose contents can change while a program runs.
  • Naming rules
    • Single word, no spaces. • Letters, digits, hyphen, underscore allowed.
    • Cannot start with a digit. • Avoid meaningless names; reflect stored value.
    • Not start with special chars (e.g., “#total” invalid).
Variable Types
  • Numeric – integers, floats, decimals (language dependent).
  • Character/Text/String – letters, digits, punctuation (e.g., NAME="WASHINGTON"\text{NAME}="WASHINGTON").
  • Logical/Boolean – TRUETRUE or FALSEFALSE only.
Constants
  • Fixed values; cannot change during execution.
  • Named constants occupy dedicated memory; referenced by identifier.
Operators
  • Arithmetic: +,,,/,%+,-,*,/,\% (modulus).
    • Statement form: \text{left_var}=\text{expression} e.g., x=x+1x=x+1.
  • Relational: >,\ge,<,\le,==,!= ; evaluate to Boolean result.
  • Logical: and,  or,  notand,\;or,\;not combine/negate Boolean conditions.

Pseudocode

  • Half-English, half-code description of algorithm; language-independent; not executable.
  • Resembles actual code structures (IF, WHILE, FOR, REPEAT, END). Focus on logic, not syntax.
  • Strengths: quickly conveys program idea to technical & non-technical audiences; can be embedded in documentation; easy to translate to any language.
  • Characteristics
    • Readable, structured, step-by-step. • No universal standard; depends on organization.
Sample Pseudocode Snippets
  1. Add two numbers
   START
   INPUT number1
   INPUT number2
   sum = number1 + number2
   DISPLAY sum
   END
  1. Rectangle area – similar pattern; multiply length & width.
  2. Square of a number – multiply number by itself.

Practice Problems (Flowchart Design)

  1. Prompt for name and height (in inches); convert height to feet (1 ft = 12 in).
    • Formula: feet=inches12\text{feet}=\dfrac{\text{inches}}{12}
    • Output pattern: “Jose, you are 7.52 feet tall.”
  2. Compute Midterm Grade: MG=13(Minor A)+23(Midterm Exam)\text{MG}=\dfrac{1}{3}\,(\text{Minor A})+\dfrac{2}{3}\,(\text{Midterm Exam}).
  3. Sales Discount: ask for purchase amount; if >2000 give 5%5\% discount; display net amount.
  4. Assignment – Year-End Bonus
    • Conditions: If monthly salary < ₱2 000 → bonus = 50 % of salary; else bonus = ₱1 500.
    • Output: employee name & computed bonus.

Ethical & Practical Implications

  • Academic honesty: cheating yields 0.000.00 grade – underscores integrity core value.
  • Accessibility: emphasis on “accessible quality education” connects to clear documentation (flowcharts/pseudocode) that aids diverse learners.
  • Maintenance mindset: use of SDLC phases, documentation, and structured design ensures sustainable software benefiting community & industry partners.