Lecture 1 PF

Download as pdf or txt
Download as pdf or txt
You are on page 1of 29

Programming Fundamentals

Course
Course Title: Programming Fundamentals
Course Code: CS-111
Credit Hours: 4 (3 + 1)

Semester: FALL 2024


Recommended Text Books
🞂 Recommended Text Books:
◦ Introduction to Programming with C++, Liang, Y.D, 3rd Edition

🞂 Reference Books:

◦ OOP using C++ by Tasleem Mustafa, Imran Saeed


◦ Turbo C++ by Robert Lafore.
◦ C++ How to Program by Deitel
Course Structure
🞂 Course Work
◦ Lectures
◦ Assignments
◦ Quizzes
◦ Project
Evaluation Criteria

S. No. Assessment Items %age


1 Assignments 5
2 Quizzes / Class Participation 10
3 Project 10
4 1st Sessional (after 4 weeks) 10
5 2nd Sessional (after 9 weeks) 15
6 Final examination (after 15 weeks) 50
Today’s Lecture

🞂 Computers
🞂 Components of computers
◦ Hardware
◦ Software
7
1. A Computer is an electronic machine
which is used for data processing.

2. A computer is a programmable machine, i.e.,


A machine that can receive, store, and
process data.
3. An electronic device for storing and processing
data, typically in binary form, according to
instructions given to it in a variable program.

4. A device that computes, especially a programmable


electronic machine that performs high-speed
mathematical or logical operations according to a set
of instructions and that assembles, stores, correlates
information.

9
🞂 Take input
🞂 Computes

🞂 Programmable electronic machine

🞂 High speed

🞂 Store information

🞂 Accept Set of instructions

🞂 Produces output

10
🞂 Two components
◦ Hardware
🞂 The physical equipment required to create, use, manipulate
and store electronic data
◦ Software
🞂 Set of instructions written in some programing language
🞂 The computerised instructions that operate a computer,
manipulate the data and execute particular functions or tasks.

11
12
🞂 Physical parts
◦ Memory (Main/ Secondary).
◦ CPU(Central Processing Unit)
🞂 ALU(Arithmetic and Logic Unit)
🞂 CU(Control Unit).
◦ I/O Devices
◦ Peripheral device
🞂 Central processing unit (CPU):
◦ The chip or chips at the heart of a computer that enable it to
process data.
◦ Also known as a processor

🞂 Memory:
◦ An area within a computer system that holds data waiting to be
processed.

🞂 Storage device:
◦ The place where a computer puts data.
🞂 Input devices
◦ The devices that allow data and instructions to enter a
computer (such as a keyboard, mouse, scanner)

🞂 Output devices:
◦ the devices that allow information to be represented (that is,
given out) to the user, such as a display screen or printer)

🞂 Peripheral device:
◦ Any piece of equipment in a computer system that is not
actually inside the computer itself.
◦ Printers, scanners and external disk drives
🞂 The most common type of memory that most
users are familiar with is ‘main memory’ or ‘RAM’
(Random-Access Memory).
🞂 RAM holds an area in the computer system unit
that temporarily holds a user’s data, operating
system instructions and program instructions.
🞂 The word ‘main’ is used to distinguish it from
external mass storage devices such as the hard
drive or disk drives.
Memory
▪ A computer’s memory consists of an ordered sequence of bytes for
storing programs as well as data that the program is working with.
▪ You can think of memory as the computer’s work area for
executing a program. A program and its data must be moved
into the computer’s memory before they can be executed by
the CPU.
▪ Every byte in the memory has a unique address, as shown in Figure
▪ The address is used to locate the byte for storing and retrieving
the data. Since the bytes in the memory can be accessed in any
order, the memory is also referred to as random-access
memory (RAM).
🞂 Read Only Memory
🞂 Memory on which data has been prerecorded.
🞂 Once data has been written onto a ROM chip, it
cannot be removed and can only be read.
🞂 Unlike main memory (RAM), ROM retains its contents
even when the computer is turned off.
🞂 ROM is referred to as being nonvolatile, whereas RAM
is volatile.
🞂 Most PCs contain a small amount of ROM that stores
critical programs such as the program that boots the
computer.
🞂 Different types of ROM
◦ PROM (programmable read-only memory).
◦ EPROM
1. Set of instructions that tells a computer
component (hardware) how to perform a
task.
🞂 Set of instruction = Program
🞂 Program is a set of instructions in any computer
programming language which directs computer to do
specific tasks.
1. Integrated set of programs

2. Program + data + documentation

3. Simulation of business processes


🞂 There are two types of software

◦ System Software

◦ Application Software.
🞂 System software – programs to control the
operations of computer equipment
◦ Operating system
◦ Compiler
◦ Loader
◦ Linker
◦ Interpreter

🞂 System software is a term referring to any


computer software which manages and controls
the hardware so that application software can
perform a task
Operating System (OS)

The operating system is the software that manages computer


hardware and software resources. It provides services for
computer programs and acts as an in-between between users
and the computer hardware. Examples include Windows,
macOS, and Linux.

Compiler

A compiler is a program that translates source code written in


a high-level programming language (like C or Java) into
machine code or an intermediate form (like bytecode). This
machine code can be executed directly by the computer's
CPU.

Loader

A loader is a part of the operating system responsible for


loading executable files into memory. It prepares the program
for execution by allocating memory and resolving any
dependencies, such as linking to libraries.

Linker

A linker is a tool that combines one or more object files


generated by a compiler into a single executable program. It
resolves references between files, ensuring that functions and
variables defined in one file can be used in another.

Interpreter

An interpreter is a program that executes instructions written in a


programming or scripting language directly, without the need for
prior compilation into machine code. This allows for immediate
execution and testing of code, making it useful for scripting
languages like Python and Ruby.
🞂 Application Software includes programs that do
real work for user.
◦ Manage student database,
◦ Payroll systems,
◦ Inventory Control,
◦ Word Processor, Spreadsheet and
◦ Database Management System etc.,
🞂 Application Software – programs that
tell a computer how to produce
information
Next Lecture

Why Programming ?

You might also like