0% found this document useful (0 votes)
8 views36 pages

Lecture 1

Uploaded by

tooba amsood
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views36 pages

Lecture 1

Uploaded by

tooba amsood
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 36

Glory be to you, we have no knowledge except what you have taught us.

Verily, it is You, the All Knower, the All-Wise.


Q[2:32]
About me
• BS (Computer System Engineering) – MUST (2012-2016)
• Global UGRAD Alumni (A Cultural Exchange Program)
• Studied 1 semester from Murray State University
• Microsoft Student Partner
• MS (Computer Engineering) – COMSATS Islamabad (2018-2020)
• Research Area – Wireless Communication (5G and beyond, Massive MIMO, Channel Modeling)
• Web Developer at DPL Software Company + UPR
• Freelancer on Fiverr
• Podcast Manager
• Teaching Experience: MYU, CUST
• Courses Taught:
• Object Oriented Programming
• Data Structures
• Database Systems
• Programming Fundamentals
• Introduction to Info and Comm. Technologies
Welcome to Course
Computer Programing/
Programming Fundamentals
Course Books
• Paul Deitel, Harvey Deitel "C: How to Program" 7th Edition
• Tony Gaddis "Starting out with C++" 8th Edition
• Maureen Sprankle, Jim Hubbard "Problem Solving and Program Design
in C" 7th Edition

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%

• There will be Relative Grading as per the University policy

08/10/2024 6
Lecture 1

08/10/2024 7
Programming and Legos

Small number of primitive constructs! [basic tools and pieces]

08/10/2024 8
Programming and Legos

Small number of primitive constructs! [basic tools and pieces]

08/10/2024 9
Programming and Legos

Or elaborate structures that even you will find difficult to understand!

08/10/2024 10
General Overview

Programming Fundamentals What is computer science, problem solving, programming?

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?

Algorithm Analysis How to efficiently solve complex problems?

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

08/10/2024 Programming Fundamentals Week #1 14


Memory Hierarchy

speed
cache

memory

disk
space

08/10/2024 Programming Fundamentals Week #1 15


Programming Languages
Programming Language
A set of rules, symbols, and special words used to construct a
computer program.
• Three types of computer languages
– Machine language
– Assembly Language
– High Level Language

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 Programming Fundamentals Week #1 19


Assembly language
• English-like abbreviations representing elementary computer
operations
• Clearer to humans
• Incomprehensible to computers
Converted to machine language by translator programs
(assemblers)
Example
load basepay
add overtimepay
store grosspay

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

08/10/2024 Programming Fundamentals Week #1 36

You might also like