Professional Documents
Culture Documents
Introduction to Computers
2020 - 2021
Lecturer
Dr………………
Email:…………………
TA
………………
Email:…………………
7
CC111 Lec#1:Introduction to the World of computers
Computers in Your Life
Information is processed
CC111 Lec#1:Introduction to the Worlddata…..
of computers
15
What Is a Computer and What Does It Do?
• Input devices
– Used to input data into the computer
– Keyboards, mice, scanners, cameras, microphones,
joysticks, touch pads, touch screens, fingerprint readers,
etc.
• Processing devices
– Perform calculations and control computer’s operation
– Central processing unit (CPU) and memory
• Output devices
– Present results to the user
– Monitors, printers, speakers, projectors, etc.
• Storage devices
– Used to store data on or access data from storage
media
– Hard drives, CD/DVD discs and drives, USB flash
drives, etc.
• Communications devices
– Allow users to communicate with others and to
electronically access remote information
– Modems, network adapters, etc.
• Define COMPUTER
• What are the 6 categories of computers
• What are the 5 basic operations
• What is hardware?
• What hardware comprises:
– Input devices
– Processing devices
– Output Devices
– Storage devices
– Communication devices?
• Web-based software:
Run directly from the
Internet
– Also called
Software as a
Service (SaaS)
and cloudware
– Includes free
software and fee-
based software
available via an
application service
provider (ASP)
• Program flowcharts
• Pseudocode
• Data modeling
Structure charts
depict the overall organization of a program, and how the
modules of a program—logically related operations that
perform a well-defined task—are defined and how they
connect to each other hierarchically.
Program flowcharts
use geometric symbols and familiar relational operators to
provide a graphic display of the sequence of steps involved in
a program.
Pseudocode
uses English-like statements in place of the graphic symbols of
the flowchart.
Data modeling:
a technique used to illustrate the data in an application and is
frequently used with object-oriented programming.
• Sequence
• Selection
• Iteration
Sequence
A sequence control structure is simply a series of
procedures that follow one another.
Selection
· The selection (if-then-else) control structure involves a choice: if
a certain condition is true, then follow one procedure; else, if
false, follow another.
When more than two possible choices exist, the case control
structure can be used instead.
True Statement1
Condition ...
Statement
False Statement2
Iteration
loop is an operation that repeats until a certain condition is met.
A looping (iteration) control structure can take two forms.
With the do-while structure, the loop is executed as long as a
condition is true; with the do-until structure, the loop continues until
a certain condition becomes true.
False
...
Condition
Statement
• Be specific
• No infinite loops
• Low-level languages
• High-level languages
• Pascal Java
– JavaScript
– VBScript
– Perl
• All boxes of the flowchart are connected with Arrows. (Not lines)
• Flowchart symbols have an entry point on the top of the symbol with no other
entry points. The exit point for all flowchart symbols is on the bottom except
for the Decision symbol.
• The Decision symbol has two exit points; these can be on the sides or the
bottom and one side.
• Generally a flowchart will flow from top to bottom. However, an upward flow
can be shown as long as it does not exceed 3 symbols.
• Connectors are used to connect breaks in the flowchart. Examples are:
• From one page to another page.
• From the bottom of the page to the top of the same page.
• An upward flow of more then 3 symbols
• Subroutines and Interrupt programs have their own and independent
flowcharts.
• All flow charts start with a Terminal or Predefined Process (for interrupt
• programs or subroutines) symbol.
• All flowcharts end with a terminal or a contentious loop.
CC111 Lec#6 : Flow Charts 3
Advantages of using Flowcharts
(programming chart)
• Communication: A Flowchart can be used as a better way of
communication of the logic of a system and steps involve in th1e solution,
to all concerned particularly to the client of system.
• Effective analysis: A flowchart of a problem can be used for effective
analysis of the problem.
• Documentation of Program/System: Program flowcharts are a vital part of
a good program documentation. Program document is used for various
purposes like knowing the components in the program, complexity of the
program etc.
• Efficient Program Maintenance: Once a program is developed and
becomes operational it needs time to time maintenance. With help of
flowchart maintenance become easier.
• Coding of the Program: Any design of solution of a problem is finally
converted into computer program. Writing code referring the flowchart of
the solution become easy.
1.
1. Start
Start
2.
2. Define
Define Problem
Problem to to Solve
Solve
3.
3. Think
Think of of an
an Algorithm
Algorithm
4.
4. Think
Think of of aa Technique
Technique for
for the
the Solution
Solution
5.
5. Write
Write Solution
Solution onon aa Piece
Piece ofof Paper
Paper
6.
6. IfIf not
not Finished
Finished Repeat
Repeat Steps
Steps 44 and
and 55
7.
7. Write
Write Code
Code andand Program
Program
8.
8. Debug
Debug and and Test
Test
9.
9. IfIf not
not Finished
Finished Repeat
Repeat Steps
Steps 77 and
and 88
10.
10. Stop
Stop
Job No
Define Problem to Solve
Done?
An Algorithm
is a complete step-by-step procedure for solving a
problem or accomplishing a task.
Start Print
Results A
On-Page
Start Or Stop Process Input/Output
Connector
Yes
Calculate
Variables
? A1
1. Simple Sequence
2. Selection Pattern
3. Loop Pattern
4. Branch Pattern
1.Simple Sequence
Read Names
No Honour
Yes
Student
?
More No
Names?
Yes
(Branch
(Branch Read Area of Concentration
Pattern)
Pattern)
Read Courses Taken
1
Compare with Criteria
Flow
Flow Charts
Charts document
document processes
processes andand interrelationships
interrelationships
of
of process
process steps
steps
Flow
Flow Charts
Charts identify
identify actual
actual and
and ideal
ideal paths
paths where
where any
any
product
product or
or process
process flows
flows
Flow
Flow Charts
Charts are
are used
used toto identify
identify problems
problems and
and potential
potential
improvements
improvements
Flow
Flow Charts
Charts can
can bebe completed
completed on on entire
entire processes
processes
assemblies
assemblies withwith allall components,
components, one one person
person or or
component
component through
through aa process,
process, combinations
combinations of of people
people
and
and machines,
machines, transactions
transactions following
following forms
forms oror other
other
documents,
documents, etc.
etc.
CC111 Lec#6 : Flow Charts 29
Advantages of Flow Charts
Communication:
Communication: Flowcharts
Flowcharts areare better
better way
way of
of
communicating
communicating the the logic
logic ofof aa system
system to to all
all
concerned.
concerned.
Effective
Effective Analysis:
Analysis: With
With the
the help
help of
of flowchart,
flowchart,
problem
problem can
can be
be analysed
analysed in
in more
more effective
effective way.
way.
Proper
Proper Documentation:
Documentation: Program
Program flowcharts
flowcharts serve
serve
as
as aa good
good program
program documentation,
documentation, whichwhich isis
needed
needed for
for various
various purposes.
purposes.
Efficient
Efficient Coding:
Coding: The
The flowcharts
flowcharts act
act as
as aa guide
guide or
or
blueprint
blueprint during
during thethe systems
systems analysis
analysis andand
program
program development
development phase.
phase.
Proper
Proper Debugging:
Debugging: The The flowchart
flowchart helps
helps inin
debugging
debugging process.
process.
Efficient
Efficient Program
Program Maintenance:
Maintenance: TheThe maintenance
maintenance
of
of operating
operating program
program becomes
becomes easy
easy with
with the
the help
help
of
of flowchart.
flowchart. ItIt helps
helps the
the programmer
programmer to to put
put efforts
efforts
more
more efficiently
efficiently on
on that
that part.
part.
Yes ?
E<1000
Subtract Expenses
No
R <= 1000-E
Print
Print You Owe $0
You Owe $R
Stop
Yes ?
E<1000
Stop
Input Expenses
EE == $950
$950 Yes E<1000
?
R
R == 1000
1000 -- EE
Subtract Expenses
No
R = 1000-E
R
R == $50
$50 Print
Print You Owe $0
You Owe $R
Stop
Y > <
? ?
N =
Start
Stop
Sum = 0
Case
Case Study
Study -- 22
N=0 N Sum
0 0
N=N+1
1 1
Sum = Sum + N
2 3
No
3 6
?
N=5
4 10
Yes
5 15
Print Sum
Stop
CC111 Lec#6 : Flow Charts 47
Case
Case Study
Study -- 33
Read A, B, C
No No
Stop
1. A = 5 ; B = 7 ; C = 3
2. A = 5 ; B = 6 ; C = 7
3. A = 5 ; B = 3 ; C = 7
4. A = 5 ; B = 3 ; C = 3
CC111 Lec#6 : Flow Charts 50
Case
Case Study
Study –– 33 (Solution
(Solution 1)
1)
A=5
Start
B=7
Read A, B, C
C=3
No No
Stop
No No
Stop
No No
Stop
No No
Stop
Fact = 1 N i Fact
i=0 5 0 1
1 1
i=i+1
2 2
Fact = Fact * i 3 6
4 24
? No
i >= N 5 120
Yes
Print Fact Stop
CC111 Lec#6 : Flow Charts 56
ADD 2 Numbers
Visual Basic(1)
llllll
Properties
Help
window
Pointer Picture
Label Text Box
Group Frame Command Button
Check Box Option/Radio Button
Combo Box List Box
Horizontal Scroll Vertical Scroll Bar
Bar Drive List Box
Timer File List Box
Directory List Box Line
Shape Data Control
Image
OLE
F1
Project
commands
Make executable
commands
Most recent project list
Exit command
• Save Component
New Project
• Open Component
Save Project As
• Add Project
Print
• Remove
Print Setup
Project
• Save Project
• Save Project As
Example
Private Sub cmdCalcTriangle_Click
Dim Base As Single
Dim Height As Single
Dim Area As Single
Area = (1 / 2) * (Base * Height)
End Sub
Where
Dim is required
variablename should be a descriptive name
As is required
datatype is one of the following types:
Boolean, Byte, Date, Integer, Long, Single, Double,
Currency, String, Object or Variant
Data Types
– Boolean - True or false
– Date - From Jan 1, 100 to Dec 31, 9999
– Integer - Numbers without a decimal point
– Long - Long integer
– Single - Numbers with a decimal point
– Double - Long Single
– Currency - Dollar amounts
– String - Character and alphanumeric data
– Object - Any object reference such as Word document
– Variant - default, can hold any data type
Variablename = value
Where
variablename is the descriptive name of the variable
= is the assignment operator
value is the value the variable will contain
Examples:
Number1 = 5
FirstName = “Steve”
Length = 17.8
Note: Order is important. Variable name always on the left, and
value on the right.
• Process: Area=
2
r
Operator
()
^
*, /
+,-
If precedence of two following operators is
equal, then the evaluation starts from left to
right.
CC111 Lec8 : Visual Basic
Simple Examples of Equations
• Original formula
WC = 0.0817(3.71(V **0.5) + 5.81 - 0.25V)(T - 91.4) +
91.4
• Visual Basic statement
WC = 0.0817 * (3.71 * Sqr(V) + 5.81 -(0.25 * V)) * (T -
91.4) + 91.4
• Output: Wind Chill (WC)
• Input 1 T: Temperature
• Input 2 V: Wind Speed
• Sequence
• Selection
– If...Then...Else statement
– Select Case statement
•
– For...Next Loop statement
– For Each...Next statement
– Do Loops
Input Output
049 F
•Input: a numeric grade 5052 D
between 0 and 5356 D+
100 5760 C-
6164 C
•Output: depends on input 6569 C+
7074 B-
7579 B
8084 B+
8589 A-
90100 A
CC111 Lec9 : Visual Basic
Selection Application
Convert from Numerical Grade to Letter Grade (Form View)
Where
Counter is tested to see if less than end.
If so, repeat loop again.
If not, go to statement after Next.
Do While condition
statements
Loop
Where
The condition is tested, and if true the loop is
repeated.
When the condition is false, the statements are
skipped after Loop is executed.
CC111 Lec9 : Visual Basic
Loops Application: Factorial
Do Until condition
statements
Loop
Where
The condition is tested, and if false the loop is
repeated.
When the condition is true, the statements are
skipped after Loop is executed.
CC111 Lec9 : Visual Basic
Loops Application: Factorial
Storage System
Computer Networks
• Transmission timing
– Synchronous transmission (at regular, specified
intervals)
– Asynchronous transmission (sent when ready)
– Isochronous transmission (sent at the same time as
other, related, data)
• Transmission directions:
– Simplex transmission
• Data travels in a single direction only
– Half-duplex transmission
• Data travels in either direction but only one way at
a time
– Full-duplex transmission
• Data travels in both directions, both ways at the
same time
• Type of connections:
– Circuit-switched: Dedicated path over a network is
established and all data follows that path
– Packet-switched: Messages are separated into small
units called packets and travel along the network
separately
• Used to send data over the Internet
– Broadcast: Data is sent out to all other nodes on the
network
• Primarily used with LANs
• Networking hardware
– Network adapter: Used to connect a computer to a
network or the Internet
• Also called network interface card (NIC) when in
the form of an expansion card
• Available in a variety of formats
– PCI and PCIe
– USB
– ExpressCard
• Adapter must match the type of network being
used (Ethernet, Wi-Fi, Bluetooth, etc.)
• Are often built into portable computers
CC111 Lec#11: Computer Networks
25
Network Adapters
• Keyword search
– Keywords are typed in a search box to locate
information on the Internet
– Matching Web pages are called hits
– Clicking on a Web page name displays that page
• Directory search
– Categories are selected to locate information on the
Internet
• Many search sites contain additional tools
– Search for music files, image files, newsgroups, news
articles, maps, people, telephone numbers
– Google is one of the most versatile search sites
• Search strategies:
– Phrase searching (more than one keyword)
– Online writing
• Blogs: A Web page that contains short, frequently
updated entries in chronological order, typically by
just one individual
• Wikis: A collaborative Web page that is designed to
be edited and republished by a variety of
individuals
– Wikipedia is largest
» Carefully evaluate content, as irresponsible
individuals can enter erroneous information
• E-portfolios: A collection of an individual’s work
accessible via the Web