Lecture 1
Lecture 1
08/10/2024 4
Announcements and course updates
• Slides and all other material will be available at Portal.
• No Quiz/Assignment retakes, So, Don’t miss a class.
• Deadlines are important.
• Class Participation is MUST.
Plagiarism
• All parties involved in any kind of cheating in (Quizzes, Assignments &
Projects) will get ZERO in that exam.
• Dishonesty will have serious ramifications.
08/10/2024 5
Marks Distribution
Assessments Type Weight
Quizzes 20%
Assignments 20%
Midterm 20%
Final 40%
08/10/2024 6
Lecture 1
08/10/2024 7
Programming and Legos
08/10/2024 8
Programming and Legos
08/10/2024 9
Programming and Legos
08/10/2024 10
General Overview
Object Oriented
Programming How to write software with the help of procedural and object-oriented programming?
Data Structures How to efficiently utilize resources with the help of different data structures?
08/10/2024 11
Computer Organization
08/10/2024 12
Random Access Memory (RAM)
• Also called memory, main memory, or primary memory
• Rapid-access of data (as compared to HDD)
• Volatile—data is typically lost when the computer’s
power is turned off
• Relatively low-capacity
• Measured in GBs
• 4 GB, 8 GB, 16 GB, and as large as 128 GB (in specially high-
end personal machines)
08/10/2024 13
Hard Disk
• Is a type of external storage
• Long-term data storage
• High-capacity
speed
cache
memory
disk
space
08/10/2024 16
Machine language
• Only language computer directly understands
o “Natural language” of computer
o Defined by hardware design
• Generally, consist of strings of numbers
o Ultimately 0s and 1s
• Instruct computers to perform elementary operations
• Cumbersome for humans
• Example instruction
01010101 11110000 10101010
08/10/2024 17
Machine Instruction Cycle
08/10/2024 18
Machine Instruction Cycle
08/10/2024 20
Assembly Language Cycle
08/10/2024 21
High Level language
• A language that is more understandable and closer to standard
notations than assembly language.
• Similar to everyday English
Uses common mathematical notations
• Single statements accomplish substantial tasks
• Converted to machine language by translator programs (compilers)
• C/C++ are high-level languages.
• Example
grossPay = basePay + overTimePay
08/10/2024 22
High-level Language Cycle
08/10/2024 23
Interpreter Cycle
08/10/2024 24
08/10/2024 25
Program Development Cycle
08/10/2024 26
From C++ Code to Process
• C++ source files
• filename.cpp; C++ source code
compiling
• Binary files
• filename.obj binary files
linking
• Executable (Windows)
• filename.exe executable
running
• Process
• Managed by OS process
From C++ Code to Process
• .cpp files contain source code
• Preprocessor performs code substitutions (e.g. #include <iostream>)
• Compiler converts expanded source code to object code
• Linker links object code file to external libraries (e.g. GLUT) and produces an executable
file
• Loader brings executable file into memory and starts executing it
C Procedural Language
C++/Java Object Oriented
Languages
SQL Non Procedural Language
Structured Programing
08/10/2024 31
Summary
• In the 1960s, a group of mathematicians proved that only three program
structures are needed to write any type of program.
• Sequence Structure:
• The simplest structure of a program is to run instructions one after the other in
the sequence that they are written
• Decision structures
• A program may (or may not) run a few instructions in the sequence based on
some condition
• Repetition structures
• A program may repeat a set of instructions a number of times