You are on page 1of 34

Programming Fundamentals

Lecture # 1
Course Information
• Title of Course : Programming
Fundamentals
• Course Code : CS102
• Credit Hours : 3+1
• Language Used : C++

2
Marking Criteria
• Assignments 15 Points
• Quizzes(Un announced) 15 Points
• Mid-Term exam 30 Points
• Final-Term exam 40 Points

3
Books
RECOMMENDED TEXT BOOK
•how to program in c++ by dietel and
dietel(3rd OR latest Edition)

REFERENCE MATERIAL
•Starting out with C++, by Tony Gaddis,
7nd
•Robert Lafore, “Object-Oriented
Programming in C++”, 3rd/4th Edition
4
Course Content
• Data Types
• Conditional Statements
• Repetition Structures
• Functions
• Arrays
• String Manipulation
• Structures
• Pointers
5
• File Handling
What is Computer?
• “Electronic device for storing and processing
data, making calculations, or controlling
machinery.” (The Pocket Oxford Dictionary)

• “An electronic device that processes data,


converting it into information that is useful to
people.” (Peter Norton)

• “A programmable, multiuse machine that


accepts data – raw facts and figures – and
processes, or manipulates, it into information
we can use.” (Williams and Sawyer)
6
What’s so special about computer?
• What makes computer different from
other machines is that:
By changing the
program Computer
(instructions), the runs program!
same computer can
be used to perform
different function

7
How Computers Work – Concept # 1

The purpose of computer is to


process data into information

Data Information

The raw facts and figures Data that has been


that are processed into summarized or otherwise
information manipulated for use in
decision making

8
How Computers Work – Concept # 2

Computers consist of
hardware and software

Hardware Software
• All the machinery and • All the instructions that tell
equipment in a the computer how to
computer system perform a task
• Tell the computer what to
• Hard devices in the
do
computer
• Also called a program
• Anything that can be
• Thousands of programs
touched
exist

9
How Computers Work – Concept # 3
• All computers follow same basic
operations.

• Input
• Processing
• Output
• Storage
• Communication (optional)
10
How Computers Work – Concept # 3

1. Input
• Input - whatever is put into
(“input”) a computer system.

• Input hardware - devices that


allow people to put data into the Keyboard
computer in a form that the
computer can use.

• Mouse - an input device that is


used to manipulate objects
viewed on the computer display
screen.

• Keyboard - an input device that


converts letters, numbers, and Mouse
other characters into electrical
signals readable by the processor.
11
How Computers Work – Concept # 3

2. Processing
• Processing - the
manipulation a computer
does to transform data into
information.

• Case or system cabinet -


the box that houses the
processor chip (CPU), the
memory chips, and the
motherboard with power
supply, as well as some
secondary storage devices.
Case or system cabinet

12
How Computers Work – Concept # 3
2. Processing
• Processor chip - A tiny
piece of silicon that
contains millions of
electronic circuits.
• Is like the brain of the
computer
• Carries out instructions
from the program
• Manipulate the data
• Most computers have
several processors
• Central Processing Unit
(CPU)
Processor chips
13
How Computers Work – Concept # 3
2. Processing
Memory chips
• Also known as RAM
(Random Access
Memory).
• Represent primary storage
or temporary storage.
• Hold data before
processing and
information after
processing.
• Also stores program
instructions
• Volatile
• More RAM results in a
faster system Memory chips
14
How Computers Work – Concept # 3
2. Processing

• Motherboard - the
main circuit board in
the computer.

• Everything else
attaches to the
motherboard through
connections called
ports.

• Expansion slots -
“plugs” on the
motherboard for
expanding the PC’s
capabilities via
additional circuit Motherboard
15
boards.
How Computers Work – Concept # 3
3. Storage
• Primary storage •Secondary storage (storage) -
vs.
(memory) - RAM

• Computer circuitry that •The area in the computer


temporarily holds data where data or information is
held permanently
waiting to be
processed

Storage capacity is represented in:


1 byte - 1 character of data.
1 kilobyte - 1,024 characters.
1 megabyte - 1,048,576 characters.
1 gigabyte - more than 1 billion characters.
1 terabyte - more than 1 trillion characters.
16
How Computers Work – Concept # 3
3. Storage

• Floppy-disk drive -
a storage device
that stores data
on removable 3.5-
inch-diameter
diskettes. Floppy disk

• Zip-disk drive - a
storage device
that stores data
on floppy-disk with
70-170 times the
capacity of the Zip disk
standard floppy.

17
How Computers Work – Concept # 3
3. Storage

• Hard-disk drive - a storage


device that stores billions
of characters of data on a
non-removable disk platter.

• Magnetic storage (Floppy


and hard drive) uses a
magnet to access data.

Hard-disk drive

18
How Computers Work – Concept # 3
3. Storage

• CD (Compact Disk)
drive or DVD (Digital
Video Disk) drive - a
storage device that
uses laser
technology to read
data from optical
disks.

• Optical storage
CD drive

19
How Computers Work – Concept # 3
3. Storage

• Flash Memory and


USB Drive

• Stores data by
turning million of
tiny switches on
and off.

Flash Memory
and USB Drive

20
How Computers Work – Concept # 3
4. Output

• Output hardware - devices


which translate information
processed by the computer
into a form that humans can
understand.

• Peripheral device - any


component or piece of
equipment that expands a
computer’s input, storage,
and output capabilities.

• Sound card - enhances the


computer’s sound-
generating capabilities by Sound card
allowing sound to be output
21
through speakers.
How Computers Work – Concept # 3
4. Output

• Speakers - the
devices that play
sounds transmitted
as electrical signals
from the sound
card.

Speakers

22
How Computers Work – Concept # 3
4. Output

• Video card -
converts the
processor’s output
information into a
video signal that can
be sent through a
cable to the monitor.

23
How Computers Work – Concept # 3
4. Output

• Monitor - the display


device that takes the
electrical signals from the
video card and forms an
image using points of
colored light on the screen.

Monitor

24
How Computers Work – Concept # 3
4. Output

• Printer - an output
device that
produces text and
graphics on paper.

Printer
25
How Computers Work – Concept # 3
5. Communications

• Modem - a device
that sends and
receives data over
telephone lines to
and from
computers.

26
Put all the hardware together and…

27
Do we need anything else?

• We still need the

Software
!
28
Software Runs The Machine
• The majority of people who purchase
computers, do so, because of software.

• They want to email, or type letters.

• Nearly every reason given to purchase a


computer is based on software needs.

• Software tells the computer what to do


• Two types
– System software
29 – Application software
Software Runs The Machine
• System software

• Helps the computer


perform essential
operating tasks and
enables the application
software to run

• The Resource Manager

• and…

30
Software Runs The Machine
• Application software

• Enables you to perform


specific tasks. e.g:

• Word Processing
• Photo Editing
• Creating web pages
• Computer Games…

31
So How to develop Software’s for Computers

32
What is Programming Language?
• A programming language is a
vocabulary and set of grammatical rules
for instructing a to perform specific
tasks.
• The term programming
language usually refers to high-level
languages, such as BASIC, C, C++,
C#, Java, FORTRAN, Ada, and Pascal.
• In this course we will study C++
programming language.
33
1 Assignment
st

Must Watch Ted Talk

How to Teach Kids to Code | Bryson


Payne | TEDxUNG
Link: https://youtu.be/s6BVSs2I7ow

34

You might also like