Introduction
Introduction
Course Plan
Basic Understanding
Pakistan Zindabad !!!
Molana Sim Zehmat Chutiya
MS Computer Science in Artificial Intelligence, UET
Lahore, B.S. in CS&E UET Lahore.
PhD in Automation.. Thesis in progress
Belongs to SIALKOT
Got First prizes in many National/International
software/hardware competitions
Development of PAK Linux at UET any many e-
Government projects
Got more than 30 First prizes in All Asia and All
Pakistan Engineering & Software Competitions as
Project Advisor
Subjects Taught so far:
Robotics & CNC Machines, Embedded Systems,
Industrial Automation, Control Systems, Artificial
Intelligence, DLD, Numerical Analysis etc
Lab Performance 70%
Personal/Professional Growth 30%
Term Project 30%
Mids 30%
Final 40%
How is a computer defined?
In Business
In Publication Field
In Education Field
In Government Organizations
In Medical Field
In Science Field
In Entertainment Field
Business
A computer has high speed of calculation,
diligence, accuracy, reliability, or versatility
which made it an integrated part in all
business organizations.
Payroll calculations
Budgeting
Sales analysis
Financial forecasting
Managing employees database
Maintenance of stocks etc.
Banking
Today banking is almost totally dependent
on computer. Banks provide following
facilities:
Admission systems
Examination
Library
Research publications
Simulation softwares
Sales and Marketing
Computers are being vastly used in
education:
Advertising - With computers,
advertising professionals create art and
graphics, write and revise copy,
and print and disseminate
At Home Shopping - Home shopping has
been made possible through use of
computerized catalogues that provide
access to product information and permit
direct entry of orders to be filled by the
customers.
Health Care
Computers have become important part in
hospitals, labs, and dispensaries
Diagnostic
Lab-diagnostic System
Patient Monitoring System
Pharma Information System
Surgery
Patient Information System
Engineering Design
One of major areas is CAD (Computer aided
design). That provides creation and
modification of images. Some fields are:
Structural Engineering - Requires stress and
strain analysis for design of Ships, Buildings, cars,
Airplanes etc.
Industrial Engineering - Computers deal with
design, implementation and improvement of
integrated systems of people, materials and
equipment.
Architectural Engineering - Computers help
in planning towns, designing buildings, determining
a range of buildings on a site using both 2D and 3D
drawings.
Military
Computers are largely used in armies
Missile Control
Military Communication
Military Operation and Planning
Smart Weapons
Communication
Some main areas in this category are:
E-mail
Chatting
Social Networking
Video-conferencing
Smart phones
Capabilities
Speed
Storage capacity
Accuracy
Reliability
Versatility
CPU Memory
16
1. Input Devices (Keyboard, Mouse, etc.)
2. Output Devices (Monitor, Speakers, etc.)
3. Central Processing Unit (CPU) and memory
4. Motherboard (Circuit Board)
5. Expansion Cards (Video Card, Sound Card, or
NIC)
6. Hard Drive Ports and Connections (USB,
Firewire, etc.)
Mouse
Keyboard
Microphone
Scanner
Webcam
Monitor
Printer
Speaker/Headphone
A device that interprets and runs the
commands that you give to the computer.
Flash Drive
CD-ROM
DVD-ROM
Universal Serial Bus (USB) Port
FireWire (similar to USB but faster)
Network Port (Ethernet)
Parallel Port and Serial Port
Display Adapter
Power
Software
Operating system
Gives services to
software:
Access input/output
devices
Hardware
Memory allocations
And much more…
26
The intangible set of instructions that tells
the computer what to do; known as
programs or software programs.
Operating System Software
◦ Sets the rules for how computer hardware and
application software work together, controls the
operation of the computer.
Example: Windows
Application Software
◦ Lets you accomplish specific tasks based on your
needs.
Examples: MS Word, Excel, Access, MS Works
Boots (starts up) the computer
Formats disks
Creates folders
Saves and retrieves files
Moves and copies files
Examples:
MS Word
MS Excel
MS PowerPoint
Internet Explorer
Word Processing
◦ Program that allows you to create, edit, and print text
documents
Report, flyer, memo
Spreadsheet
◦ Numbered Rows and Lettered Columns
◦ Intersection of a row and column is a cell
Grade book, financial info
Database
◦ Lets you set up an electronic filing system
◦ Enter text and numbers
Find, search, and print info in different ways
Address book, Card Catalog
I want to add one and one 1+1 010011010011
compiler
C++/Java/VC/V
B/.Net/C#
32
What is a network?
Collection of computers and devices connected together
Communications
Device Communications
Media
Enables a Satellites
Cables
connection
Telephone Cellular
between
lines radio
computers
One type is
a modem
33
Why do we need network?
To share
Resources
Hardware
devices
Software
programs To save
Data
time
Information and
money
34
What is a server?
Manages the
resources on
a network
A client accesses
the resources
on the server
3
5
What is the Internet?
Worldwide collection of networks that connects
millions of computers
3
6
Why do users access the Internet?
1. Communications
2. Information
3. Shopping
4. Banking and Investing
5. Classes
6. Entertainment
3
7
What is the World Wide Web (WWW)?
Billions of documents, called Web pages, available to
anyone connected to the Internet
A Web site is
a collection of
related Web pages
A Web page contains
text, graphics, sound,
video, and links to You can share
other Web pages information by
creating Web pages
or posting photos on
a photo community
3
8
How do you install and run a software program?
Step 3.
The program executes
3
9
What is a graphical user interface (GUI)?
4
0
What is system software?
Programs that control the operations of the computer
and its devices
4
1
What is application software?
Word
Spreadsheet
Processing
Presentation
Database
Graphics
4
2
What is a programmer?
4
3
What are the categories of computers?
4
4
Whatare the two most popular series of personal
computers?
PC and compatibles Apple Macintosh
use the Windows uses the Macintosh
operating system operating system
(Mac OS)
4
5
What is a desktop computer?
Designed so all of the components fit on or under
a desk or table
4
6
What is a notebook computer?
47
What is a tablet PC?
Resembles a letter-sized slate
Allows you to write on the screen
using a stylus
Smaller version is the modular
computer
48
What is a personal digital assistant (PDA)?
49
What types of servers are there?
50
What are five categories of computer users?
5
1
What software is available for a home user?
• Web access
• Entertainment
• Communications
5
2
What software is available for a small
office/home office (SOHO) user?
Productivity software
Specialty software
Web usage
5
3
Whatis available for Notebook
computers
a mobile user?
Hardware
Software
Productivity
Presentation Handheld computers
Personal
information
manager
Web-enabled
cellular phones
5
4
What are the needs of the large business
user?
Web access
Public kiosk
Telecommuting
Network
Productivity software
Scheduling
5
5
What are the needs of a power user?
5
6
What are some examples
of computer applications
in society?
Education
Finance
Government
Healthcare
Science
Publishing
Travel
Industry
5
7
What are information system elements ?
People
Procedures
Data Step 1. Step 2.
Software People People use software to
Hardware develop enter data into
procedures computer (hardware)
for processing
data
Step 3.
Software processes
data and directs
hardware to store and
or output information
5
8
Database:
a very large, integrated collection of data.
Models a real-world enterprise
◦ Entities (e.g., teams, games)
◦ Relationships
(e.g., student grade and marks)
◦ More recently, also includes active components ,
often called “business logic”. (e.g., ranking system)
Buffer Management
DB
Efficient data access
Data integrity & security
Data administration
Concurrent access, crash recovery
Reduced application development time
So why not use them always?
◦ Expensive/complicated to set up & maintain
◦ This cost & complexity must be offset by need
◦ General-purpose, not suited for special-purpose tasks (e.g.
text search!)
DBMS vendors, programmers
◦ Oracle, IBM, MS, Sybase, …
End users in many fields
◦ Business, education, science, …
DB application programmers
◦ Build enterprise applications on top of DBMSs
◦ Build web services that run off DBMSs
Database administrators (DBAs)
◦ Design logical/physical schemas
◦ Handle security and authorization
◦ Data availability, crash recovery
◦ Database tuning as needs evolve
DBMS used to maintain, query large datasets.
◦ can manipulate data and exploit semantics
Other benefits include:
◦ recovery from system crashes,
◦ concurrent access,
◦ quick application development,
◦ data integrity and security.
DBAs, DB developers the
bedrock of the information
economy
STEP 1
STEP 2
STEP 3
. . .
How Do We Write a Program?
◦ A computer is not intelligent.
◦ A computer frees people from repetitive and boring
tasks.
DEBUG DEBUG
REVISE
CODE
GOAL
TEST
THINKING
CODE
Is NOT portable
Examples:
◦ FORTRAN
◦ JAVA
◦ C++
written in
written in written in
machine
C++ machine
language
language
other code
from libraries,
etc.
A sequence is a series of statements that
execute one after the other
Statement1
Condition ...
Stateme
nt Statement2
WHILE Condition DO statement1
False
Condition ...
Statement
SUBPROGRAM1 ...
SUBPROGRAM1
a meaningful collection
of SEQUENCE,
SELECTION, LOOP,
SUBPROGRAM
Ask Questions – about the data, the process,
the output, error conditions.
T1
T2
exit
Selection (test)
If cond then task1
Y
Cond task1
While
While (cond) do
endwhile
Do while /Repeat
Do
while (cond)
Ordered sequence
◦ T1, T2, T3 T1
T2
T3
T1
◦ T1, repeat 5 times T2, T3
same as T1, T2, T2, T2, T2, T2, T3
T2
5 times
T3
◦ T1, T2, “if C = true, go to second T2”, T3
resulting sequence is
T1, T2, T2,...until C is true,T3
T1
T2
C
Y
T3
What is the difference between:
S1 S1
Y
S2 C
C S2
Y
S3 S3
Computation of income tax
Given a tax table as below, compute the tax, T, on
an income, X.
INCOME TAX
0 <= INC <=100000 0
100001 <= INC <=200000 0 + 0.10*(INC-100000)
200001 <= INC <=300000 10000 + 0.20*(INC-200000)
300001 <= INC 30000 + 0.30*(INC-300000)
Here is an algorithm:
Step 3: Output T
Table look-up: Consider:
◦ special key K,
◦ length of list, 5 or N, more generally
◦ unsorted L = [(x1, y1), (x2, y2), (x3, y3), (x4, y4), (x5, y5)],
where xi is key and yi is corresponding output value
Problem is to search whether key K is in the list and
output relevant pair if it exist
Here is an algorithm:
Input K;
Repeat these operations 5 times:
[Input (x, y);
If K = x then output (x, y)
]
An even better algorithm:
Input n;
If n > 0 then
[Input K;
Repeat these operations n times:
[Input (x, y);
If K = x then output (x, y)
]
]
Use flowcharts to visualize the working of an
algorithm
start
For example:
S1
S2
true
C
false
S3
stop
Problem 1:
Find the roots of a quadratic equation of
the form a*x2 + b*x + c = 0