Programming Fundamentals 1, Lecture notes of Technology

An introductory computer science course focused on fundamental programming concepts, logic, and problem-solving.

Typology: Lecture notes

2025/2026

Available from 03/27/2026

jekka-oliva
jekka-oliva 🇭🇰

40 documents

1 / 8

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Central Processing Unit (CPU) - brain of the computer
Control Unit (CU) - responsible for directing operations within the processor
Memory Unit (MU) - RAM, HDD, SSD, etc.
Arithmetic and Logic Unit (ALU) - combinational digital circuit that performs arithmetic and
logical operations on binary numbers
data - raw facts and figures represented in numbers, characters, symbols, images, etc, can be
processed manually or automatically
30, 40, 50. 75, 85. 95. 100
yes, yes, yes, no, yes no, no, no
Classification of data
Numeric data - quantitative data
Non numeric data - qualitative data
Data types - classification that specifies the type of data that a variable can hold
Numeric data types
Integer (signed numbers - negative) (unsigned numbers - positive)
Real (float/double/single)
Percentage
Currency
Non-numeric data
text/alphanumeric/string
boolean
date/time (because it has non-numeric characters)
Levels of programming language
Low-level language - machine language
Middle-level language - assembly language
High-level language - java/c++/c/vb/pytthon/turbo pascal
Number systems
- fundamental to computer science as they enable data representation, processing, and
communication, allowing computers to understand and manipulate information effectively
(used to handle various types of data efficient)
Types of number systems in computing
Decimal number system
Decimal ns - 10 (0 to 9)
Binary ns - 2 (0 and 1)
Octal ns - 8 (0 to 7)
Hexadecimal - 16 (0 to 9)
deca 10: A - 10
B - 11
C - 12
pf3
pf4
pf5
pf8

Partial preview of the text

Download Programming Fundamentals 1 and more Lecture notes Technology in PDF only on Docsity!

Central Processing Unit (CPU) - brain of the computer ● Control Unit (CU) - responsible for directing operations within the processor ● Memory Unit (MU) - RAM, HDD, SSD, etc. ● Arithmetic and Logic Unit (ALU) - combinational digital circuit that performs arithmetic and logical operations on binary numbers

data - raw facts and figures represented in numbers, characters, symbols, images, etc, can be processed manually or automatically ● 30, 40, 50. 75, 85. 95. 100 ● yes, yes, yes, no, yes no, no, no

Classification of data ● Numeric data - quantitative data ● Non numeric data - qualitative data

Data types - classification that specifies the type of data that a variable can hold

Numeric data types ● Integer (signed numbers - negative) (unsigned numbers - positive) ● Real (float/double/single) ● Percentage ● Currency

Non-numeric data ● text/alphanumeric/string ● boolean ● date/time (because it has non-numeric characters)

Levels of programming language ● Low-level language - machine language ● Middle-level language - assembly language ● High-level language - java/c++/c/vb/pytthon/turbo pascal

Number systems

  • fundamental to computer science as they enable data representation, processing, and communication, allowing computers to understand and manipulate information effectively (used to handle various types of data efficient)

Types of number systems in computing ● Decimal number system ○ Decimal ns - 10 (0 to 9) ○ Binary ns - 2 (0 and 1) ○ Octal ns - 8 (0 to 7) ○ Hexadecimal - 16 (0 to 9) ■ deca 10: A - 10 B - 11 C - 12

D - 13

E - 14

F - 15

C: printf.(“Hello world!”) C++: Cout<<”Hello world!” Java: Object oriented, System.out.println(“Hello world!”) VB: Print ”Hello world!”

Bits (B) - binary digit Byte (Kb) - 8 bits - 1 char Kilobyte (KB) - 1024 bytes Megabyte (MB) - 1024 KB/kilobytes GIgabyte (GB) - 1024 MB/megabytes Terabyte (TB) - 1024 GB/gigabytes Zettabyte (ZB) - 1024 TB/terabytes Bigger→desti 1.5gb - bytes

Software

  1. Application Software - software designed to handle specific tasks for users
  2. System Software - foundational software that manages and controls a computer’s hardware. More important than application software because you cannot download applications if you don’t have a system software

Source Code - human readable program. Every programming language needs a compiler. Object Code - machine readable program/language Syntax - the grammar of a particular language. ● Syntax error - code that violates the rules of a programming language ● Logic error (run time error) - mistake in a program’s code that leads to unexpected or incorrect outcomes during results. Responsibility of a programmer to be logical ○ Bug - program errors , unintentional error or defect in computer software or hardware ○ Debug - identify and solve problems or errors in the code ○ Debugging - process of finding, isolating, and resolving coding errors, known as bugs, in software program

Int a, b, sum; a = 10; b = 15; sum = a + b; cout<<”The sum is: “< ● C - Dennis Ritchie, Bell Laboratories, structured programming language ● C++ (created from C) - Bjarnes Stroustrup, Bell Laboratories, structured programming language and object-oriented programming ● Java (created from C++, originally called Oak Language) - James Gosling, Sum Microsystems, bought by Oracle Corporation, object-oriented programming ● C# (created from C++ and Java) - web platform and games

Operators: it is a symbol that triggers numeric and non-numeric calculations ● Central Processing Unit (CPU) - brain of the computer ○ Control Unit (CU) - responsible for directing operations within the processor ○ Memory Unit (MU) - RAM, HDD, SSD, etc. ○ Arithmetic and Logic Unit (ALU) - combinational digital circuit that performs arithmetic and logical operations on binary numbers ● Hertz - number of actions per second Variable - Value - constant in its essence Expression: a combination of operators and operands ● Example: sum = a + b;

Types of Operators

  1. Arithmetic operator - addition (+). subtraction (-), multiplication (*), division (/), modulo (%) ● Modulus operator - an operator that returns the remainder of an integer division ○ ans = 12 % 3 = 0 ○ ans = 30 % 10 = 0 ○ ans = 15 % 4 = 3
  2. Relational/Conditional/Selection operator - greater than (>), less than (<), equal to (==), greater than or equal to (>=), less than or equal to (<=), not equal (!=) (<>) ● Precedence of operators ○ ans = 5 * 3 / 5 + 10 - 3 = 10 ○ ans = 12 / 3 * 5 - 10 + 5 = 15 ■ Expression inside parentheses ■ Exponentiation ■ M/D ■ S/A ● Boolean operator ○ ans = 5 > 3; true ○ ans = 4 < 5; true ○ ans = 10 <> 10; false ○ ans = 5 >= 5; true ○ ans = 4 <= 4; true ○ ans = 6 >= 4; true
  3. Logical operator - NOT, OR, AND ● AND (multiplication) ( && ) ○ Given 1 = true and 0 = false Therefore: 0 * 0 = 0

● OR operator (addition) ( || ) ○ Given 1 = true and 0 = false Therefore: 0 + 0 = 0 0 = 1 = 1 1 + 0 = 1 1 + 1 = 2 0 + 0 + 0 + 0 + 1 = 1 ● NOT operator (! ) ○ ans = NOT (5 > 4) = false ○ ans = NOT (5 < 4) = true

Full blocked, semi-blocked, hanging indention Room Directory “Mother” - C:&gt;, D:&gt;, F:&gt;

javac.exe - compiler java.exe - interpreter

GUI - graphical user interface CLI - command line interface

Program Control Structures (PCS) - these are the building blocks of programming where statements are carried out/executed sequentially, conditionally or relatively and statements can be executed repeatedly. ● Sequence Structure ● Selection Structure/Conditional Structure ○ Single Selection - if () Statement; OR if () Statement1; Statement2; StatementN; ■ if(grade >=70) System.out.print(“Congratulations! You made it!”) System.out.print(“Congratulations! You made it!”) System.out.print(“Ako rin!”); ○ Double Selection ○ Multiple Selection - nested if’s if () statement1; else if () statement2;

statement; exp3; }

do-while: exp1; do { statement; exp3; }while (exp2);

Importance of Program Control Structures to Programming Logic Why does Program Control Structures matter in Programming Logic?

  1. It is because ● They define the flow of program execution. ○ Without them, code would execute linearly ○ They enable decision making ○ Through selection structures like if, if-else, and if-else-if/switch, programs can respond to different inputs or conditions. ■ A log-in system checks if a password is correct before granting access. ○ They Support Repetition and Efficiency ■ This avoids redundancy ○ They improve Readability and Maintainability. ■ It prevents “spaghetti code” by organizing logic into clear, modular blocks ■ Structured logic makes code easier to understand, debug, and modify ○ Think of control structures like planning your day: ■ Sequential: Wake up → brush teeth → eat breakfast FOR LOOP for(a=1; a<6; a++){ for(b=1; b<6; b++) System.out.print(b+ “\t”); System.out.print(); }

for(exp1; exp2; exp3) statement; OR for(exp1; exp2; exp3){ statement1; statement2;

statementN }

WHILE exp1; while(exp2);{

statement; exp3; }

DO-WHILE exp1; do{ statement; exp3; }while(exp2);

Arrays Java Foundation Classes: (JFC) ● AWT Components (Abstract Windowing Toolkit) ● Swing Components

Cyber Security Applications and Implementations Database Management Systems (DBMS)