CS101 MCQs 500
CS101 MCQs 500
1. 1.
115.
objec t
-
or ie nte d p ar adig m,
whi c h is a ss oc ia t ed wit h t he pr ogr a mmi ng pr oc ess ca l l ed
ob ject
-
or ie nte d
progr ammi ng(O O P).
F oll owi ngt hispar a digm, a soft wa r esyst emisvi eweda sacol l ect i onofunit s, ca ll e d
objec ts,
ea ch of whic h is ca pa ble of p er for mi ng t he a ct i ons t ha t ar e i mmedia t el y r ela t ed
t o it s el f a s wel l a s
r equ est i ng a ct ions of ot her obj ect s. T oget her , t hes e ob j ect s
As a n exa mp l e of t he object
-
or i ent ed a ppr oa ch a t wor k, consi der t he t a sk of devel op i ng a gr a phica l user
i nt er fa ce. I n a n obj ect
-
or i ent ed envir onment , t he ic ons t ha t a ppea r on t he scr een wou l d b e i mp l ement
ed a s
ob j ect
s. Ea ch of t hes e obj ect s wou l d enc ompa ss a col l ect i on of fu nct i ons (ca l l ed
me t ho ds
i n t he ob j ect
-
or i ent ed ver na cula r ) descr ibi ng how t ha t obj ect is t o r espond t o t he oc cur r enc e
of va r ious event s, such a s
bei ng sel ect ed by a clic k of t he mous e but t on or bei
ng dr a gged a cr oss t he scr een by t he mous e.
T hus,
t he
ent ir e s yst em woul d b e c onst r uct ed a s a col l ect i on of obj ect s, ea c h of whic h
knows how t o r esp ond t o t he
event s r ela t ed t o it .
i nt r odu ct i on
. T o t his end, r eca ll t ha t a n obj ect ca n c ons ist of da t a (such a s a list of na mes) t
oget her wit h a
col l ect i on of met hods f or per
-
a
class .
Onc e a cla ss ha s been c onst r uct ed, it ca n be a ppli ed a nyt i me a n ob j ect wit h t hos
e c ha r a ct er ist ics is
needed. T hus, sever a l ob j ect s ca n b e ba s ed on (t ha t is, built fr om) t he sa me cla ss .
J
ust like i dent ica l t wi ns,
t hes eob j ect swou l dbedist i nct ent it i esbut wou ldha vet hesa mec ha r a ct er ist icsbeca
uset heya r econst r uct ed
fr om t he sa me t emp la t e (t he sa me c la ss ). (An ob j ect tha t is based on a par t icula r
cla ss is sa id t o b e a n
i nst ance
of t ha
t cla ss . )
Intr oduct i on t o Com put in g
CS101
VU
P ag e
201
of
3 81
Hi gh
-
l evelpr ogr a mmi ngla ngua gesa ll ow loca t i ons in ma i n memor yt ob er ef er enc edby
descr ipt i vena mes
r at her t ha n by nu mer ic a ddr ess es. S uch a na me is known a s a
vari ab le,
in
r ec ognit i on of t he fa ct t ha t by
cha ngi ng t he va lu e st or ed a t t he loca t ion, t he va lu e a ss oc ia t ed wit h t he na me
cha nges a s t he pr ogr a m
ex ecut es. Unli ke P yt hon, our exa mp l e la ngua ges i n t hi s cha pt er r equ ir e t ha t va
r ia bles b e i dent if i ed via a
decla r a t ive st a t e
ment pr i or t o bei ng us ed els ewher e i n t he pr ogr a m. T hes e dec la r a t ive s t a t
ement s a ls o
r equir e t ha t t he pr ogr a mmer descr ib e t he t yp e of da t a t ha t wi l l be st or ed a t t he
memor y l oca t i on a ss ocia t ed
wit h t he va r ia ble.
++,Ja va ,
a nd C # we wou l d dec la r e our int ent i on by i ns er t i ng t he st a t ement
i nt We ig htL i mi t;
i nt H e ig ht, Wid t h;
i nt We ig htL i mi t = 100;
wou l dnot onl ydec la r eWei ght Limi t t obeavar ia bleoft yp ei nt eger buta lsoa ss ignit t
hest ar t ingva lu e100.
In c ont r a st , dyna mica l l y t yp ed
la ngua ges l i ke P yt hon a ll ow va r ia bles t o b e a ss igned wit hout fir st decla r i ng
t heir t ype; suc h va r ia bl es ar e chec ked f or cor r ect t yp e l a t er , when op er a t ions
a r e per f or med upon t hem.
c ha r a ct er .
CS101
VU
P ag e
202
of
3 81
wou l d be r ea sona bl e.
JP EG, a nd HT ML
mi ght soon b ec ome a s com mon a s int eger a nd f l oa t .
VU
P ag e
203
of
3 81
117.
i nt S cores[2 ][9];
a t wo
-
wou l d be wr it t en a s
INT E GE RS c
ores (2, 9)
Onc ea na r ra yha sbeendec la r ed, it ca nber ef er enc edels ewher ei nt hepr ogr a mb yit
sna me, or a nindi vi dua l
el ement ca n b e i dent if i ed b y mea ns of i nt eger va lu es c a ll ed
i ndi ces
t ha t spec if y t he r ow, c olu mn, a nd s o
on, des ir ed. However , t he r a ng
e of t hes e ind ic es va r i es fr om la ngua ge t o la ngua ge. F or exa mp l e, i n C (a nd
it s der i va t i ves C ++, Ja va, a nd C #) indic es st a rt at 0, mea ni ng t ha t t he ent r y i n t
he s ec ond r ow a nd f our t h
colu mn of t he a r ra y ca ll ed S c or es (a s dec la r ed a bove) wou l d b e r ef er enc ed
by S c or es[1][3], a nd t he ent r y
i n t he fir st r ow a nd fir st colu mn wou ld b e S cor es[0 ][ 0]. In cont r a st , indic es st a rt
a t 1 in a F ORT R AN
pr ogr a m s o t he ent r y i n t he s ec ond r ow a nd f our t h c olumn wou l d b e r ef er enc ed
b y S cor es(2, 4) (s ee a ga i n
F igur e 94).
Fi gure
94
: A t wo
-
di mensi onal arr ay wi t h t wo ro ws and ni ne col umns
CS101
VU
P ag e
204
of
3 81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
oft yp ec ha r a ct er , a nent r yca l l ed Age oft yp e int eger , a nda n ent r yca l l edS ki llR a t
i ngoft yp ef l oa t . S ucha n
a ggr ega t e t yp e wou ld b e dec la r ed i n C by t he st a t ement
str uc t
{c har
Name [25];
i nt Age ;
flo at S ki l lR at i ng;
} E mploy ee;
F igur e
95
: T he c onc ept ua l la yout of t he st r uct ur e Emp l oyee
CS101
VU
P ag e
205
of
3 81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
118.
Progr ammi ng
L ang uages: Ass ig n me nt S tat e me nt
Z := X + Y;
CS101
VU
P ag e
206
of
3 81
119.
A
co ntro l stat e me nt
a lt er s t he
ex ecut i on sequ enc e of t he pr ogr a m. Of a ll t he pr ogr a mmi ng c onst r uct s.
i f (co nd it io n)
S tate me nt A
else
S tate me ntB .
if ( ma r ks> =50)
Els e
CS101
VU
P ag e
207
of
3 81
120.
flo at f=3. 5;
i f (CG
PA>=3. 0)
else
CS101
VU
P ag e
208
of
3 81
121.
T her e is a not her t ype of cont r ol st r uct ur e known a s l oop. T he l oop c ont r ol st r uct
ur e it er a t es a set of
i nst r uct ions ba sed on t he pr ovided condit i on.
is a s foll ows :
Doi ng
t his usi ng l oop
i nt i=1;
w hi le (i< =5)
co ut<< i;
i= i+1;
a nd t he c ondit i on woul d
be t r ue a s 2<
CS101
VU
P ag e
209
of
3 81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
122.
e c ons t r uct ed by cr ea t i ng mu lt ip l e
a ct iva t i ons of t his pr ogr a m, ea ch wit h it s own set of para met er s. By ex ecut i ng t
hes e a ct i va t ions
si mu lt a neous ly, we c ou l d obt a i n t he i l lusi on of ma ny i ndivi dua l spa ces hips st r
ea ki ng a cr oss t he scr een a t
t he sa me t i me.
Ma ny moder nc omput er a pplica t ionsa r emor e ea si l ysol vedi nt hec ont ext ofpar a
llelpr oc ess ingt ha
ni nt h e
mor et r a dit i ona lc ont ext invol vi nga si ngl es equ enc eofi nst r uct ions. I nt ur n, newer
pr ogr a mmi ngla ngua ges
pr ovi des ynt a xfor expr ess i ngt hes ema nt icst r uct ur esi nvolvedi npa r a ll elc omput a t
i ons. T hedes i gnofsuc h
a la ngua ge r equ ir es t he i dent if i
ca t i on of t hes e s ema nt ic st r uct ur es a nd t he devel op ment of a synt a x for
r epr es ent i ng t hem.
Ea chpr ogr a mmi ngla ngua get endst oa ppr oa cht hepa ra ll elpr oc ess i ngpar a digmfr
omit sownpoi nt ofvi ew,
r esult ing in diff er ent t er mi nol ogy. F or exa mp l e, wha t we ha v
e inf or ma ll y r ef er r ed t o a s a n
act i vat i on
is
ca ll ed a
t ask
in t he Ada ver na cula r a nd a
t hread
in Ja va . T ha t is, in a n Ada pr ogr a m, si mult a neous a ct ions
a r e per for med b y cr ea t ing mu lt ipl e
t asks,
wher ea s in Ja va one cr ea t es mu lt ip l e
t hreads.
In eit her ca se,
the
r esult is t ha t mu lt ip l e a ct i vit i es a r e gener a t ed a nd ex ec ut ed i n muc h t he sa me
wa y a s pr ocess es under t h e
cont r ol of a mu lt it a ski ng op er a t ing syst em. W e wi l l a dopt t he Ja va t er mi nology
a nd r ef er t o such
P er ha ps t he most ba sic a c
t ion t ha t must be expr ess ed i n a pr ogr a m i nvol vi ng pa ra ll el pr oc ess i ng is t ha t
of
cr ea t i ng new t hr ea ds. If we wa nt mult ip l e a ct iva t i ons of t he spa ces hip pr ogr a m
t o be ex ecut ed a t t he sa m e
t i me, we need a synt a x for sa yi ng so. S uch spa wni ng of new t hr ea ds i
s si mi la r t o t ha t of r equ est i ng t h e
ex ecut i on of a tr a dit i ona l funct i on. T he diff er enc e is tha t , in t he t ra dit i ona l s et t
i ng, t he pr ogr a m unit t ha t
r equ est s t he a ct iva t i on of a funct i on does not pr ogr ess a ny fur t her unt i l t he r
equ est ed funct i on t er mi na t es
(
r eca l l F igur e 6. 8), wher ea s i n t he pa ra ll el cont ext t he r equ est i ng pr ogr a m u nit
c ont i nu es ex ecut ion whi l e
t he r equ est ed funct ion p er for ms it s ta sk (F igur e 96).
T hus,
t o cr ea t e mu lt ip l e spa ce
-
s hips s tr ea ki ng a cr os s
t he scr een, we wou l d wr it e a ma i n pr ogr a m t ha t simp l y gener a t es mu lt ip l e a ct
i va t ions of t he spa ces hip
pr ogr a m, ea c h pr ovi ded wit h t he pa ra met er s descr ibi ng t he dist i nguis hi ng cha r
a ct er ist ics of t ha t spa cesh
ip.
CS101
VU
P ag e
210
of
3 81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
Fi gure
96
:
Spawni ng t hreads
A mor e c omp l ex iss u e a ss ocia t ed wit h pa ra ll el pr oc ess ing i nvol ves ha ndli ng c
ommu nica t i on b et wee n
t hr ea ds. F or inst a nc e, i n our spa ceship exa mp l e, t he t hr ea ds r epr es ent i ng t h
e diff er ent spa ceships mi ght
needt oc ommu nica t et heir loca t i onsa mongt hems el vesi nor der t ocoor di na t et heir a
ct ivit i es. Inot her
ca ses,
one t hr ea d mi ght need t o wa it unt il a not her r ea ches a cer t a in point in it s computa
t ion, or one t hr ea d mi ght
need t o s
t op a not her one unt il t he fir st ha sa ccompl is hed a pa rt icula r ta sk.
S uch c ommu nica t i on needs ha ve l ong b een a t opic of st udy a mong c omput er sci ent
ist s, a nd ma ny newer
pr ogr a mmi ng la ngua ges r ef l ect va r ious a ppr oa ches t o t hr ea d i nt er a ct i on pr obl
ems. As a n ex
a mp l e, l et us
cons i der t he c ommu nica t i on pr obl ems enc ou nt er ed when t wo t hr ea ds ma nipu la
t e t he sa me da t a . If ea ch of
t wot hr ea dst ha t a r eex ecut i ngc oncur r ent ly needt oa ddt heva lu et hr eet oa
commonit em ofda t a ,a met ho d
is needed t o ensur e t ha t one t hr e
a d is a ll owed t o c omplet e it s t r a nsa ct ion b ef or e t he ot her is a ll owed t o
per f or m it s t a sk. Ot her wis e t hey c ou l d bot h st a r t t heir i ndivi dua l c omput a t
ions wit h t he sa me i nit ia l va lu e,
whic h wou l d mea n t ha t t he fi na l r esu lt wou ld b e i ncr ement ed by onl y t hr ee
r a t her t ha n six. Dat a t ha t ca n
be a cc ess ed by onl y one t hr ea d a t a t i me is sa id t o ha ve mut ua ll y exc lusi ve a cc
ess .
CS101
VU
P ag e
211
of
3 81
123.
C
-
la ngua ge ha s t he f oll owing a r it hmet ic op er a t or s:
Addit i on
-
S ubtr a ct ion
Mult ip li ca t ion
Di vis i on
Modulus
+,
-
op er a nds
5. 0/ 2. 0 woul d r esu lt i nt o 2. 5.
However , when bot h op er a nds a r e int eger s, t hen it wou l d t r unca t e t he dec i ma l
point a nd
5/ 2 wou l d r esult i nt o 2.
5%2 wou l d gi ve 1.
124.
C
-
la ngua ge ha s t he f oll owing r ela t iona l op er a t or s:
<
Les s t ha n
<=
Les s t ha n or equa l t o
>
Gr ea t er t ha n
>=
Gr ea t er t ha n or equa l t o
==
Equa l t o
!=
Not Equa l t o
if st a t ement .
Tr ue, t hen
if st a t ement
r et ur ns va lu e
13. 13.
1.
Fa lse, t h
en
i f st a t ement
r et ur ns va lu e
14. 14.
0.
#i nc l ud e<iost re am>
us i ng name sp ac e std;
void
mai n()
i nt
if
( a>b)
VU
P ag e
212
of
3 81
if
( a<b)
cout<<" a is s mal l er" <<e nd l;
if
( a<=c)
if
( a>=c)
O ut p ut
a is s mal ler
==
(Is Equa l t o) a nd
!=
#i nc l ud e<iost re am>
us i ng name sp ac e std;
i nt num1 = 30;
i nt num2 = 40;
i nt num3 = 40;
O utp ut
CS101
VU
P ag e
213
of
3 81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
125.
1.
C
-
la ngua ge L ogi ca l Oper a t or s ar e used if we wa nt t o compa r e mor e
2.
3.
Oper ators
Name o f t he
Oper ator
T ype
&&
AND Op er a t or
Bi na r y
||
OR Oper a t or
Bi na r y
NOT Oper at or
Una r y
O per ator
O ut p ut
AND
Out put is 1 onl y when c ondit i ons on bot h si des
of Op er a t or become T r ue
OR
NOT
us i ng
name sp ac e
st d;
i nt
ma i n()
{
i nt
nu m1=30;
i nt
nu m2=40;
if
( nu m1> = 40 || nu m2> = 40 )
if
( nu m1> = 20 & & num2> = 20 )
ret ur n
0;
O ut p ut:
CS101
VU
P ag e
214
of
3 81
AND If B l oc k G et s Execut ed
E xp l anat io n o f t he Prog ra m
if
( nu m1>40 || nu m2>=40)
if
( nu m1>=20 & & nu m2>=20)
T hus,
T rut h T abl e
O per ator
1st
Cond it io n
2nd
Cond it io n
O ut p ut
AND
Tr ue
Tr ue
Tr ue
Tr ue
F a lse
F a lse
F a lse
Tr ue
F a lse
F a lse
F a lse
F a lse
OR
Tr ue
Tr ue
Tr ue
Tr ue
F a lse
Tr ue
F a lse
Tr ue
Tr ue
F a lse
F a lse
F a lse
NOT
Tr ue
F a lse
F a lse
Tr ue
Intr oduct i on t o Com put in g
CS101
VU
P ag e
215
of
3 81
S oftware
E ngi nee ri ng: S oft ware E ngi nee r i ng Disc i pl i ne
T o a ppr ecia t e t he pr ob l ems i nvol ved i n s oft wa r e engi neer i ng, it is helpfu l t o s el
ect a lar ge c omp l ex devic e
(a n a utomob il e, a mult ist or y of fi c e buil ding, or per ha ps a ca t hedr a l) a nd i ma
gine b ei ng a sked t o desi gn
it
a nd t hen t o super vis e it s const r uct ion. How ca n you est i ma t e t he c ost i n t i me,
money, a nd ot her r esour c es
t o compl et e t he pr oj ect ? H ow ca n you di vide t he pr oj ec t int o ma na gea b l e pi ec
es? How ca n you ensur e t ha t
t hepi ec espr oduc eda r ec ompa t ib l e?H owca
nt hos ewor ki ngont he va r ious pi ec es c ommu nica t e?Howca n
you mea sur epr ogr ess ?Howca n youcop e wit ht he wi der a nge ofdet a il(t hes el ect i on
oft hedoor knobs, t he
des i gn of t he ga r goyl es, t he a va i la bi lit y of blu e gla ss for t he st a i ned gla ss wi
ndows, t he
st r engt h of t h e
pil la r s, t hedes i gn oft he duct wor kf or t hehea t i ngs yst em)?Qu est ions oft hesa mesc
op e must bea ns wer ed
dur i ng t he devel op ment of a lar ge soft wa r e syst em.
One suc h dist i nct i on i nvol ves t he a bi lit y t o c onst r uct syst ems fr om gener ic pr efa
br ica t ed c omp onent s.
-
t he
-
s eei nt hisc ha pt er , signif ica nt pr ogr ess isbei ngma dei nt hisr ega r d, a lt hou ghmor e
wor k r ema i ns t o b e done.
Anot her dist inct i on b et ween soft wa r e engineer i ng a nd ot her engineer i ng dis cip l i
nes is t he la c k of
qua nt it a t ive t ec hni qu es, ca ll ed
me tr ics,
for
mea s ur i ng t he pr op er t i es of s oft wa r e. F or exa mp l e, t o pr oj ect
t hec ost ofdevel op i nga soft wa r es yst em, onewou l dl i ket oest i ma t et hec omp l ex it
yoft hepr opos edpr oduct ,
t ing t he qua l it y of a
soft wa r e pr odu ct is cha l l engi ng. In t he ca se of mec ha ni ca l devic es, a n i mpor t a nt
mea sur e of qua l it y is t he
mea n t i me b et ween fa i lur es, whic h is ess ent ia ll y a mea sur ement of how wel l a
devic e endur es wea r .
S oft wa r e, i nc ont r a st ,doesn
ot wea r out ,sot hismet hodofmea sur i ngqua l it yisnot a sa pplica bl ei ns oft wa r e
engineer i ng.
T he dif fi cult i es i nvol ved i n mea sur i ng soft wa r e pr oper t i es i n a qua nt it a t ive ma
nner is one of t he r ea sons
t ha t soft wa r e engi neer i ng ha s str uggl ed t o fi nd a
r igor ous foot i ng i n t he sa me s ens e a s mec ha nica l a nd
el ect r ica l engi neer i ng. Wher ea s t hes e la t t er subject s ar e fou nded on t he est a blis
hed sci enc e of physi cs,
soft wa r e engi neer i ng cont i nu es t o sea r ch f or it s r oot s.
CS101
VU
P ag e
216
of
3 81
VU
P ag e
217
of
3 81
127.
ngesi nt he
soft wa r e, or cha nges ma de dur i ng a pr evi ous modi fi ca t i on ar e fou nd t o indu c e pr
obl ems els ewher e i n t he
soft wa r e.
Exper i enc e ha s shown t ha t a lit t l e eff or t dur ing t he devel op ment of soft wa r e ca n
ma ke a t r emendous
diff er enc e when modif ica t i ons a r e r equ ir ed.
Fi gure
97
: T he sof t
ware l i f e cycl e
CS101
VU
P ag e
218
of
3 81
128.
t he goa l of whic h is
to
s pec if y wha t s er vi c es t he pr opos ed s ys t em wil l pr ovi de, t o ident if y a ny con dit i
ons (t i me c ons t r a int s ,
secur it y, a nd so on) on t hos e s er vic es, a nd t o defi ne how t he out si de wor l d wi ll i
nt er a ct wit h t he s yst em.
R equir ements a na lys is i nvol ves si gnif ica nt inpu
t fr om t he
st ake ho lde rs
(futur e user s a s well a s t hos e wit h
ot her t i es, such a s l ega l or fi na nc ia l i nt er est s) of t he pr op os ed s yst em. I n fa ct ,
in ca ses wher e t he ult i ma t e
user isa nent it y, sucha sa compa nyor gover nment a genc y, t ha t int endst ohir ea sof
t wa r edevel op er for t he
a ct ua l ex ecut i on of t he s oft wa r e pr oj ect , r equ ir ement s a na lys is ma y st a r t by a
fea sib il it y st udy conduct e d
sol el y b y t he us er . In ot her ca ses, t he soft wa r e devel op er ma y be i n t he busi ness
of pr odu ci ng
co mme rc i al
off
-
t he
-
s hel f (CO T S
)
soft wa r e for t he ma ss ma r ket , per ha ps t o be sol d in r et a i l st or es or downl oa ded
via
t he Int er net . In t his s et t i ng t he user is a less pr ec is el y defi ned ent it y, a nd r equir
ement s a na lys is ma y begi n
wit h a ma r ket st udy by t he soft wa r e devel op er . In a ny ca se,
t ra de
-
offs b et ween wa nt s, needs, cost s, a nd f ea sib il it y; a nd fina ll y devel op i ng a set of r
equir ement s t h
at
i dent i f y t he f ea t ur es a nd ser vi c es t ha t t he f i nis hed soft wa r e syst em must ha ve.
T hes e r equ ir ement s a r e
r ec or dedi na docu ment ca l l eda
softw arer eq ui re me nts speci fi c at io n.
I na sens e, t hisdocu ment isa wr it t en
a gr eement bet ween a l l pa rt i es conc er ned, w
pla n onc e t he f ou nda t i on ha s been c onst r uct ed, but inst a nc es a bound of or ga niza
t i ons t ha t ha ve expa nded,
or ot her wis ea
nda t or y.
Fi gure
98
:
T he tradi t ional devel opment phase of t he sof t ware l i f e cycl e
CS101
VU
P ag e
219
of
3 81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
129.
what
a soft wa r e syst em i s
t o do, wher ea s des i gn is equa t ed wit h dec i ding
ho w
t he s yst em wi l l do it . Alt hough t his des cr ipt i on is
enl i ght eni ng, ma ny soft wa r e engi neer s a r gue t ha t it is fla wed b eca us e, in a ct ua
lit y, t her e is a lot of
how
cons i der ed dur i ng r equir ement s a na l ys is a nd a lot of
wh at
cons i der ed dur i ng des i gn.
It is in t he
des ign st a ge t ha t t he int er na l st r uct ur e of t he soft wa r e syst em is est a blis hed. T
he r esult of t h e
CS101
VU
P ag e
220
of
3 81
130.
CS101
VU
P ag e
221
of
3 81
131.
onl ya r t ifa ct st ha t a r et est eddur i ngt hesoft wa r edevel op ment pr oc ess . Indeed, t
her esu lt of ea c h
CS101
VU
P ag e
222
of
3 81
132.
S oftware E ngi nee ri ng: S oft ware E ngi nee r i ng Met h odolog ies (I)
Ea r ly a ppr oa ches t o soft wa r e engi neer ing i ns ist ed on p er for mi ng r equ ir ement s
a na l ysis, des i gn,
i mp l ement a t i on, a ndt est i ngi na str ict lys equ ent ia lma nner . T hebel i ef wa st ha tt
oo muc hwa sa tr iskdur ing
t he devel op ment of a la r ge soft wa r e syst em t o a ll ow
for va r ia t ions. As a r esult , soft wa r e engi neer s i nsist e d
t ha t t he ent ir e r equir ement s speci fi ca t i on of t he syst em b e compl et ed bef or e begi
nni ng t he des i gn a nd,
li kewis e, t ha t t he desi gn b e c omp l et ed b ef or e b egi nni ng i mp l ement a t ion. T he
r esu lt wa s a devel op
ment
pr oc ess now r ef er r ed t o a s t he
wate r
-
-
a nd
-
er r or
pr oc ess t ha t is oft en vit a l t o cr ea t i ve pr obl em
sol vi ng. T his is illust r a t ed by t he emer genc e of t he
i ncre me nt al mo de l
for soft wa r e devel op ment . F oll owi ng t his model, t he des ir ed soft wa r e syst em is
const r uct edi ni ncr ement s, t hefir st bei nga simp li fi edver sionoft hefi na lpr oduct wit hl
i mit edfu nct i on
a l it y.
Onc e t his ver s i on ha s been t est ed a nd p er ha ps eva lua t ed by t he futur e us er , mor
e f ea t ur es ar e a dded a nd
t est ed i n a n i ncr ement a l ma nner unt il t he syst em is c ompl et e. F or exa mp l e, if t
he s yst em b ei ng devel op ed
isa pa t ient r ec or dss yst emf or a hosp it
a l, t hef ir st incr ement ma yi ncor p or a t eonl yt hea bi l it yt ovi ewpa t i ent
r ec or ds fr om a sma l l sa mpl e of t he ent ir e r ec or d sys t em. O nc e t ha t ver si on is
op er a t iona l, a ddit i ona l
f ea t ur es, such a s t he a bil it y t o a dd a nd upda t e r ec or ds, wou l d be a dded i n a st
ep
wis e ma nner .
t ha t wa scr ea t edbyt heR a t iona lS oft wa r eC or por a t ion, whic his nowa divis i
onofIBM. R UP is ess ent ia
lly
a soft wa r e devel op ment pa ra di gm t ha t r edef i nes t he st eps i n t he devel op ment
pha s e of t he s oft wa r e l if e
cycl e a nd pr ovi des gu i del i nes f or per for mi ng t hos e st eps. T hes e gu i deli nes, a
long wit h C AS E t ools t o
suppor t t hem, a r e ma r ket ed by I BM. T oda y, R UP is
CS101
VU
P ag e
223
of
3 81
133.
S oftware E ngi nee ri ng: S oft ware
E ngi nee r i ng Met h odolog ies (I I )
oft hepr op os edsyst emisqu ic klyconst r uct edi nt heea r l yst a gesofdevel op ment . S ucha
pr ot ot yp e
ma y c onsist of onl y a few scr een i ma ges t ha t gi ve a n i ndi ca t ion of how t he s yst em
wi l l i nt er a ct wit h it s
user s a nd wha t ca pa bilit i es it wi ll ha ve. T he goa l
is not t o pr oduc e a wor ki ng ver si on of t he pr oduct but t o
obt a i n a demonst r a t ion t ool t ha t ca n be used t o cla r if y com mu nica t i on b et ween
t he pa r t ies i nvol ved i n t h e
soft wa r e devel op ment pr oc ess . F or exa mp l e, ra pid prot ot yp es ha ve pr oved a dva
nt a geous i n cla r
if yin g
syst em r equ ir ement s dur i ng r equ ir ement s a na lys is or a s a ids dur ing sa l es pr es
ent a t ions t o p ot ent ia l c li ent s.
fr eesoft wa r e ispr oduc ed. P er ha pst he most pr omi nent exa mp l eist heL i nuxop er a t
ingsyst em whos e op en
-
t hem i nt o t he p os t e d
ver si on of t he s oft wa r e, ma king t his ext ended ver si on a va ila bl e f or fur t her modif
ica t i ons. In pr a ct ice, it is
poss ib l e f or a soft wa r e pa cka ge t o evol ve t hr ough s ever a l ext ensi ons i n a singl e
week.
CS101
VU
P ag e
224
of
3 81
134.
S oftware
E ngi nee ri ng: S oft ware E ngi nee r i ng Met h odolog ies (II )
Akeyp oi nt ist ha t t omodi f ysoft wa r eone must under st a ndt hepr ogr a mor a tlea st t
hep er t i nent par t soft he
pr ogr a m. Ga ini ng such a n under st a ndi ng is oft en dif fi c ult enou gh i n t he ca s e of s
ma l l pr ogr
a ms a nd wou l d
be c l os e t o i mp oss ibl e when dea li ng wit h la r ge s oft wa r e s yst ems if it wer e not f
or
mod ul ari ty
t ha t is, t he
di vis i on of soft wa r e i nt o ma na gea bl e u nit s, gener i ca l l y ca ll ed
mo d ules,
ea c h of whic h dea ls wit h onl y a
Modules c ome i n a va r i et y of f or ms. W e ha ve a lr ea dy s een t ha t i n t he c ont ext of
t he i mp er a t ive pa r a digm,
modu l es a ppea r a s funct ions. In c ont r a st, t he obj ect
-
or i ent ed pa ra di gm
us es ob j ect s a s t he ba sic modu la r
const it u ent s. T hes edist i nct i onsa r ei mp or t a nt beca us et hey det er mi net heu nder l
yi nggoa l dur i ngt hei nit ia l
soft wa r e des ign pr oc ess . Is t he goa l t o r epr es ent t he over a ll t a sk a s i ndivi dua l,
ma na gea bl e pr oc ess es or t o
i den
t i f y t he ob j ect s in t he s yst em a nd under st a nd how t hey i nt er a ct ?
we wou l dnee d
t odet er mi net hepa t hoft heba l l(W i l lit hit t henet ?W her ewil lit bou nc e?). W emi ght p
la nonpla c ingt hes e
comput a t ions in a not her fu nct i on na med C omput eP a t h. T he ne
xt st ep mi ght b e t o det er mi ne if t he ot her
pla yer is a ble t o r et ur n t he ba ll, a nd if
so,
Not e t ha t t he st r uct ur e cha r t does not indica t e how ea ch funct i on is t o per for
m it s t a sk. Ra t her , it mer el y
i dent i fi es t he fu nct i ons a nd i ndi ca t es t he dep endenc i es a mong t he fu nct i ons. In
r ea l it y, t he fu nct i on
C ont r olGa me mi ght p er for m it s t a sk by fir st ca ll i ng t he S er ve fu nct i on, t hen r
ep ea t edl y ca ll i ng on t he
funct i ons C omput eP a t h
Fi gure
99
: A si mpl e st ruct ure chart
CS101
VU
P ag e
225
of
3 81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
135.
Fi gure
100
In
CS101
VU
P ag e
22
6
of
3 81
CS101
VU
P ag e
227
of
3 81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
136.
Inob j ect
-
or i ent eddes i gns, ent ir eobject sa r eusua ll yonl yl ogi ca l l ycohes i veb eca uset he met
hods wit hina n
ob j ect oft en p er f
or m l oos el y r ela t ed a ct i vit i es
Fi gure
101
: L ogical and f unct i onal cohesi on wi t hin anobject
CS101
VU
P ag e
228
of
3 81
137.
CS101
VU
P ag e
229
of
3 81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
138.
-
t he
-
over , i nher it a nc epr ovi desa mea nsofr efi ningpr efa br ica t edob j ect defi nit i onsi nt
hos eca sesinwhic h
t he defi nit ions must be cust omi z ed t o conf or m t o t he needs of a spec i
f ic a pp lica t i on. It is not s ur pr is i ng,
t hen, t ha t t he obj ect
-
or i ent ed pr ogr a mmi ng la ngua ges C ++, Ja va , a nd C # ar e a ccompa ni ed b y c oll ect
ions
r ol es. In p
a r t icula r , C ++ is ass ocia t ed wit h t he C ++ St a nda r d T emp la t e Libr a r y, t he Ja va
pr ogr a mmi ng
envir onment is a ccompa ni ed by t he Ja va Appl ica t i on P r ogr a mmer I nt er fa ce ( AP
I), a nd C # pr ogr a mmer s
ha ve a cc ess t o t he . NET F ra mewor k C la ss Libr ar y.
T he fa ct t ha t obj ec
t s a nd cla ss es ha ve t he p ot ent ia l of pr ovi di ng pr efa br ica t ed buil di ng bl oc ks f or
soft wa r e
des i gn does not mea n t ha t t hey a r e idea l. One pr obl em is t ha t t hey pr ovi de r ela t i
vel y s ma ll bl oc ks fr o m
whic h t o bu il d. T hus, a n obj ect is a ct ua ll y a spec ia l c a se of
t he mor e gener a l c onc ept of a
co mpo ne nt,
whic h is, by def i nit i on, a r eusa ble u nit of soft wa r e. I n pr a ct ice, most component s
a r e ba sed on t he ob j ect
-
or i ent edpa r a digma ndt a ket he f or mofa col l ect i on of one or mor e obj ect st ha t
funct i ona sasel f
-
c ont a i ned
unit .
As i defr omt he mot i va t iont o li mi t t heus e ofsyst emr es our c es, t hec omp onent a r
chit ect ur e ofs ma r t phones
pa ys di vi dends i n i nt egr a t ion bet ween a pplica t i ons. F or exa mp l e, Fa ceb ook (a
well
-
known socia l
n
et wor ki ng syst em) when ex ecut ed on a sma r t phone ma y us e t he c omp onent s of t
he c ont a ct s applica t i on
t o a dd a ll F a ceb ook fr iends a s cont a ct s. F ur t her mor e, the t el ephony a pplica t i on
(t he one t ha t ha ndl es t h e
funct i onsoft hephone), ma ya lsoa cc ess t he c ont a c
CS101
VU
P ag e
230
of
3 81
139.
S oftware E ngi nee ri ng: Des ig n
Patte r ns
Ani ncr ea si ngl ypower fu lt oolf or soft wa r e engi neer sist hegr owi ngc ol l ect i onof desi
gnpa t t er ns. A
desig n
patte r n
is a pr e
-
devel op ed model f or sol vi ng a r ecur ri ng pr obl em i n soft wa r e des i gn. F or exa mp
l e, t h e
Ada pt er pa t t er n pr ovi des a solut i on
T he
soft wa r e devel op ment pa cka ges suc h a s t he Ja va pr ogr a mmi ng envir onment s pr
ovi ded b y Or a cl e a nd t h e
. NET Fr a mewor k pr ovi ded by M icr os oft . I ndeed, ma
ny of t he t emp la t es f ou nd i n t hes e t ool kit s a r e
ess ent ia l ly des i gn pa t t er n skel et ons t ha t l ea d t o r ea dy
-
ma de, hi gh
-
qua l it y solut i ons t o des ign pr ob l ems.
CS101
VU
P ag e
231
of
3 81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
140.
t hefa ct or yst ar t s
ma nufa ct ur ingt hos eit emsa swell. F a ct or ycla sspr ovidesa bstr a ct ionbet weenC l i ent
a ndC arwhencr ea t ing
t hei nst a nc e oft heC a r[Honda , BMWet c]incr ea si ngl ypower fult oolfor soft wa r eengi
neer sist hegr owi ng
col l ect i on of des i gn
Fi gure
102
: Fact ory
Desi gn Pat t ern
CS101
VU
P ag e
232
of
3 81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
Fi gure
103
: Shoppi ng C art Desi gn Pat t ern
CS101
VU
P ag e
233
of
3 81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
141.
S ever a l t he
st epi nt hedevel op ment pr oc essbea ccur a t el ydocu ment edf or futur er ef er enc e.
However , t hisgoa lc onfl i ct s
wit h hu ma n na t ur e. An iss u e is t he t empt a t ion t o ma ke
decis i ons or cha nge dec isi ons wit hout upda t i ng t h e
r ela t eddocu ment s. T her esult ist hec ha nc et ha t r ec or dswi llb ei nc or r ect a ndhenc
et heir usea t fut ur est a ges
wi ll b e mis l ea di ng. H er ei n li es a n i mp or t a nt benef it of C AS E t ools. T hey ma ke
suc h t a sks a s
r edr a wi ng
dia gr a msa ndupda t ing da t adict i ona r ies muc h ea si er t ha nwit h ma nua l met hods. C
ons equ ent l y, upda t esar e
mor el i kel yt obe ma dea ndt hef i na ldocu ment a t i onis mor eli kel yt obea ccur a t e.(T
hisexa mpl eisonl yone
ofma nyi nst a nc esinwhic hs oft wa r
eengi neer ingmust c op ewit ht hefa ult sofhu ma nna t ur e. Ot her si nc lu de
t he i nevit a bl e p er sona l it y c onf l ict s, jea lous i es, a nd ego cla shes t ha t a r ise when
p eopl e wor k t oget her . )
CS101
VU
P ag e
234
of
3 81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
142.
such
t est i ng is i nexa ct a t best . We ca nnot gua r a nt ee t ha t a piec e of soft wa r e is cor r
ect via t est ing u nl ess we r un
enou gh t est s t o exha ust a ll poss ibl e s c ena r ios. But , even i n si mp l e pr ogr a ms, t
her e ma y b e bi l li ons of
diff er ent pa t hst ha tcouldpot ent ia l l y
bet r a ver sed. T hus,t est i nga llposs iblepa t hswit hinacomp l expr ogr a m
is a n i mp oss ib l e t a sk.
On t he ot her ha nd, soft wa r e engi neer s ha ve devel op ed t est i ng met hodologi es t ha t
i mpr ove t he odds of
r evea l i ng er r or s i n soft wa r e wit h a l i mit ed nu mb er of t est s.
i n a unif or m, less
-
t hor ou gh ma nner . T his is a n inst a nc e of t he pr opos it i on known a s t he
Pare to pri nc ip le,
i n r ef er enc e t o t he ec onomist a nd
mea ning t ha t t he
-
b ox t est i ng, one is not c onc er ned wit h how t he soft wa r e goes a bout it s
t a sk but mer el y wit h whet her t he soft wa r e p er for ms c or r ect l y in t er ms of a ccur
a cy a nd t i mel i ness .
An exa mp l e of bla ck
-
b ox t est i ng is t he t ec hni qu e, ca ll ed
bo und ary val ue analysis,
t ha t consist s of
i dent i f yi ngr a ngesofda t a , ca ll ed
eq uiv ale nce cl asses,
over whic ht hes oft wa r eshou l dp er for m i na si mi la r
ma nner a ndt hent est i ngt hes oft wa r eonda t a clo
s et ot he edge oft hos er a nges. F or exa mp l e, ift hes oft wa r e
is supposed t o a cc ept input va lu es wit hi n a spec if i ed r ange, t hen t he soft wa r e wou
l d be t est ed a t t he l owest
a nd hi ghest va lu es i n t ha t r a nge, or if t he soft wa r e is suppos ed t o coor di na t e mu
lt ip l
e a ct ivit i es, t hen t h e
soft wa r e wou ld b e t est ed on t he la r gest poss ib l e c ol l ec t ion of a ct ivit i es. T he
under l yi ng t heor y is t ha t by
i dent i f yi ng equ i va l enc e cla ss es, t he nu mb er of t est ca ses ca n be mi ni miz ed b
eca use c or r ect op er a t ion f or a
f ew exa mpl es wit hi
n a n equ iva l enc e c la ss t ends t o va l i da t e t he soft wa r e f or t he ent ir e c la ss . Mor
eover , t he
best c ha nc e of i dent if yi ng a n er r or wit hin a cla ss is t o use da t a at t he cla ss
edges.
al p ha test i ng.
) T he a dva nt a ges of bet a t est i ng
ext end fa r beyond t he t r a dit i ona l disc over y of er r ors. Gener a l cust omer f eedba ck
(b ot h p osit ive a n d
nega t i ve) is obt a ined t ha t ma y a ss ist in r ef i ni ng ma r ke
t st r at egi es. M or eover , ea r ly dist r ibut i on of b et a
CS101
VU
P ag e
235
of
3 81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
soft wa r e a ss ist s ot her soft wa r e devel op er s in des i gni ng compa t ibl e pr odu ct s. F
or exa mp l e, i n t he ca se of a
new op er a t i ng syst em f or t he P C ma r ket , t he dist r ibut i on of a bet a ver sion enc
our a ges t he devel op m
ent of
compa t ibl eut i l it ysoft wa r esot ha t t hefi na lop er a t ingsys t emult i ma t elya ppea r
sonst or eshel vessurr ounded
bycompa nionpr oduct s. Mor eover , t heex ist enc eofbet a t est ingca ngener a t eafeel i
ngofa nt ic ipa t ionwit hin
t he ma r ket pla c e
a n a t mospher e
t ha t incr ea s es publi cit y a nd sa les.
CS101
VU
P ag e
236
of
3 81
143.
whent h e
soft wa r e is r el ea s ed t o t he pub li c. Us er docu ment a t i on tr a dit i ona ll y t a kes t he
f or m of a phys ica l b ook or
bookl et , butinma nyca sest hesa mei nf or ma t i onisi nc lu deda spar toft hesoft wa r eit
self. T hisa llowsa user
t o r ef er t o t he docu ment a t i on whil e usi ng t he s oft wa re. In t his ca se t he inf or ma
t ion ma y b e br oken i nt o
sma llu nit s, somet i mesca l l edhelppa cka g
es, t ha t ma ya ppea r ont hedisp la yscr eena ut oma t ica l l yi ft heus er
da l li es t oo l ong bet ween c om ma nds.
T he pur pos e of
s ys te m doc u me nt at io n
soft wa r eca nb ema i nt a i nedla t er i nit sl if ec ycl e. A
ma j or comp onent ofs yst emdocu ment a t ionist hes our c e
ver si on of a l l t he pr ogr a ms i n t he s yst em. It is i mp or t a nt t ha t t hes e pr ogr a ms
b e pr es ent ed i n a r ea da bl e
for ma t , whi c h is why soft wa r e engi neer s suppor t t he use of wel l
-
des i gned, hi gh
-
l evel pr ogr a mmi n g
la ngua ges, t heus e ofc omment st a t ement sf or a nnot a t i nga pr ogr a m, a nda modu la r
des i gnt ha t a ll ows ea ch
modu l e t o b e pr es ent ed a s a coher ent u nit . I n fa ct , most compa ni es t ha t pr oduc
e s oft wa r e pr oduct s ha v e
a dopt ed convent i ons for t heir emp loyees t o fol l
ow when wr it i ng pr ogr a ms. T hes e i nc lu de i ndent a t i on
convent i ons for or ga ni zi ng a pr ogr a m on t he wr it t en pa ge; na mi ng convent i ons t
ha t est a blis h a dist i nct i on
bet ween na mes of diff er ent pr ogr a m c onst r uct s such a s va r ia bles, const a nt s, obj
ect s, a nd cla ss es;
a nd
docu ment a t ion c onvent i ons t o ensur e t ha t a ll pr ogr ams a r e suffic i ent ly docu
ment ed. S uch convent i ons
ma i nt ena nc e pr oc ess .
T he pur pos e of
te c hni c al doc u me nt at io n
is t o des cr i be ho w a s oft wa r e s ys t em s hou l d b e i ns t a l l ed a nd
ser vic ed (su
c h a s a djust i ng op er a t ing pa ra met er s, inst a ll i ng upda t es, a nd r epor t i ng pr obl
ems ba ck t o t h e
T hedist i nct i onb et weent echnica ldocu ment a t i ona ndus er docu ment a t i onisblur r
edi nt heP C a r ena beca use
t heuser isoft ent heper sonwhoa ls
oi nst a llsa ndser vic es t hesoft wa r e. However , inmu lt ius er envir onment s,
t he dist i nct i on is sha r per .T her ef or e, t ec hni ca l docu men t a t ion is i nt ended for t
he syst em a dmi nist r a t or who
VU
P ag e
237
of
3 81
VU
P ag e
238
of
3 81
144.
th
e soft wa r e syst em.
be t he det er mi ni ng fa ct or in t he succ es s
or fa ilur e of a soft wa r e engineer i ng pr oj ect .
Ab enef ic ia r yofr es ea r chi nt hisfi el dist hes ma r t phone i nt er fa ce. Inor der t oat ta int
he goa l ofa conveni ent
poc ket
-
s iz ed devi
c e, el ements of t he t r a dit iona l hu ma n
-
ma c hi ne i nt er fa ce (fu l l
-
si z ed keyboa r d, mous e,
scr ol l bar s, menus) ar e bei ng r epla c ed wit h new a ppr oaches; such a s gest ur es per
for med on a t ouch scr een,
voic ec om ma nds, a nd vir t ua lkeyb oa r dswit ha dva nc ed a ut o
-
comp l et i
on of wor dsa ndp hr a ses. Whi l et hes e
r epr es ent si gnif ica nt pr ogr ess , most sma r t phone us er s wou l d a r gue t ha t t her e
is pl ent y of r oom f or fur t her
i nnova t i on.
R es ea r ch i n hu ma n
-
ma c hi ne i nt er fa c e des i gn dr a ws hea vi l y fr om t he ar ea s of engi neer ing ca ll e d
ergo no
mi cs,
whic hdea lswit hdes i gnings yst emst ha t ha r moniz e wit ht hephys ica la bilit i esofhu ma
ns, a nd
cog net ics,
whic h dea ls wit h des i gni ng syst ems t ha t harmoni z e wit h t he ment a l a bilit i es of hu
ma ns. Of t he
t wo, er gonomics is t he bet t er under st ood, la r gel y beca use hu ma ns ha ve b een i nt
er a ct ing physi ca ll y wit h
ma c hi nes for cent ur i es. Exa mpl es ar e fou nd in a nc i ent t ools
, wea ponr y, a nd t r a nspor t at ion syst ems. Much
of t his hist or y is self
-
evi dent ; however , a t t i mes t he a ppli ca t ion of er gonomics ha s been cou nt er i nt uit i
ve.
An oft en
-
cit ed exa mpl e is t he des i gn of t he t yp ewr i t er keyb oa r d ( now r ei nca r na t ed a s t
he comput er
keyb o
h
a bit s ca n a ls o l ea d t o
er r or s, even when t he des i gn of a n i nt er fa c e i nt ent i ona l l y a ddr ess es t he pr ob l
em. C ons ider t he pr oc ess of a
hu ma n a ski ng a t ypica l op er a t ing syst em t o del et e a fil e. T o a voi d uni nt ent i ona l
del et i ons, most int er fa c es
r espond t o such a
c ea ses t o b e a t wo
-
st ep pr oc ess c ons ist i ng of a del et e com ma nd f ol l owed b y a t hou ght fu l r esp ons e
toa
qu est i on
. Inst ea d, it bec omes a one
-
t ha t a nincor r ect del et er equ est ha sbeensubmit t ed, t herequ est ha sa lr ea dybeenc onf
ir meda ndt he del et i on
ha s occur r ed.
CS101
VU
P ag e
239
of
3 81
T he f or ma t i on of ha bit s ma y a ls o c
a use pr ob l ems when a hu ma n is r equ ir ed t o us e sever a l a ppli ca t io n
soft wa r e pa cka ges. T he i nt er fa ces of suc h pa c ka ges ma y b e s i mi la r yet diff er ent
. S i mila r user a ct ions ma y
r esult i n diff er ent syst emr esp ons es or si mi la r syst emr espons es ma yr equir edif f er
e
nt user a ct ions. Int hes e
ca ses ha bit s devel op ed in one a ppli ca t ion ma y l ea d t o er r or s in t he ot her a pplica t
i ons.
t he li ght
T he
G O MS
met r icsi nt he fi el d of hu ma n
-
e
t a sksint er msofus er goa ls(sucha sdel et ea wor dfr om at ext ), oper a t or s(sucha sclic kt
he mous ebut
-
t on),
met hods (suc h a s doubl e
-
c li c k t he mous e but t on a nd pr ess t he del et e key), a nd sel ect i on r ul es (such a s
choos e b et ween t wo met hods of a ccomp lis
hi ng t he same goa l). T his, in fa ct , is t he or igi n of t he a cr ony m
GOMS
goa ls, op er a t or s, met hods, a nd sel ect i on r ul es. In shor t , GOMS is a met hodol ogy
t ha t a ll ows t h e
a ct ions of a huma n usi ng a n int er fa c e t o b e a na l yz ed a s sequ enc es of el ementa r y
st eps (pr e
ss a key, mov e
t he mous e, ma ke a dec is i on). T he per f or ma nc e of ea ch el em ent a r y st ep is a ss
igned a pr ec is e t i me p er i od,
a ndt hus, bya ddi ngt het i mesa ss i gnedt ot hest epsi na t ask, GOMS pr ovi desa mea nsofc
ompa r ingdiff er ent
pr opos ed i nt er fa c es i n t er ms
of t he t i me ea c h woul d r equir e when p er for mi ng si mi la r t a sks.
Under st a ndi ng t he t ec hni ca l det a i ls of syst ems suc h a sGOMS is not t he pur pos e of
our cur r ent st udy. T he
point i nour ca seist ha t GOMSisfoundedonf ea t ur esof hu ma nb eha vi or (movi ngha nds,
ma
ki ngdec is i ons,
a nd s o on). I n fa ct , t he devel op ment of GOMS wa s or igina ll y c ons i der ed a t op ic i
n ps yc hol ogy. T hus,
CS101
VU
P ag e
240
of
3 81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
T hedes i gnofhu ma n
-
ma c hinei nt er fa cespr omis est ob ea na ct ivef i el dofr es ea r chi nt hefor es eea b l efutur
e.
in
t he us e of t hr ee
-
di mens i ona l i nt er fa c es t ha t ar e now on t he hor iz on. Indeed, b eca us e t hes e i nt
er fa ces
pr omis et oc omb i nea udi oa ndt a ct il ec ommu nica t i on wit ht hr ee
-
VU
P ag e
241
of
3 81
145.
S oftware
E ngi nee ri ng: S oft ware O w ne rs hip and L i ab i l ity
Most wou l da gr eet ha t acompa nyor indi vi dua lshoul dbea ll owedt or ec oup, a ndpr ofit
fr om, t heinvest ment
needed t o devel op qua l it y s oft wa r e. Ot her wis e, it is u nli kel y t ha t ma ny woul d b
e wi ll i ng t o under t a ke
t he
t a sk of pr oduc i ng t he s oft wa r e our soci et y des ir es. In s hor t , soft wa r e devel op er
s need a l evel of owner ship
over t he soft wa r e t hey pr oduc e.
Whi l e c op yr i ght s a nd
s oft wa r e li c ens e a gr eement s pr ovi de l ega l a venu es t o i nhib it out r i ght c opyi ng
a nd
una ut hor iz ed us e of s oft wa r e, t hey a r e gener a l l y i nsuff ic i ent t o pr event a not
her pa rt y fr om i ndep endent l y
devel op i ng a pr oduct wit h a nea r ly i dent ica l fu nct i on. It is sa d t ha
t over t he yea r s t her e ha ve b een ma ny
oc ca sions wher e t he devel op er of a tr uly r evolut i ona r y soft wa r e pr oduct wa s una
ble t o ca pit a liz e fu l ly o n
his or her i nvent i on (t wo not a bl e exa mp l es a r e spr ea dsheet s a nd web br ows er s).
In most of t hes e ca ses,
a not her c
ompa ny wa s succ ess ful i n devel op i ng a comp et it i ve pr oduct t ha t secur ed a domi
na nt s ha r e of t h e
ma r ket . A l ega l pa t h t o pr event t his i nt r usion by a compet it or is fou nd i n pa t ent
la w.
One dr a wba ck t o t he us e of pa t
ent s is t ha t t he pr oc ess t o obt a i n a pa t ent is exp ens i ve a nd t i me
-
c onsu mi ng,
oft en i nvol vi ng s ever a l yea r s. Dur ing t his t i me a soft wa r e pr odu ct cou l d bec
ome obs ol et e, a nd unt il t h e
pa t ent is gr a nt ed t he a pplica nt ha s only qu est i ona bl e a ut hor it y t o ex clu de
ot her s fr om a ppr opr ia t ing t he
pr oduct .
M ot i on (R IM
t he ma ker s of t he B la c kB er r y
CS101
VU
P ag e
242
of
3 81
F ina l l y, wes hou l da ddr esst heissu eoflia bil it y. T opr ot ect t hems el vesa ga inst l ia
bilit y, soft wa
r edevel op er s
oft eni nc lu dedisc la i mer si nt hesoft wa r eli c ens est ha t sta t et hel i mit a t i onsoft heir
lia bil it y. S uchsta t ement s
lia bil it y ca ses t end t o focus on whet her t he def enda nt used a level of ca r e compa t
ibl e
wit ht hepr oduct b ei ngpr odu c ed. Al evelofca r et ha t mi ght bedee m
eda cc ept a bl ei nt heca s eofdevel opi ng
a wor d pr ocess i ng syst em ma y be c onsi der ed negl i gent when devel op i ng soft wa r e
t o cont r ol a nucl ea r
r ea ct or . C ons equ ent l y, one of t he b est def ens es a ga i nst soft wa r e l ia bil it y cla i
ms is t o a pply sou nd soft wa r e
engi neer
CS101
VU
P ag e
243
of
3 81
146.
R eca l l t ha t a n
arr ay
ofa r ra yist he one
-
di mensi ona la r ra y, asingl er ow of el ement s wit h ea c hpos it i on i dent i fi edb ya n i
ndex. A
one
-
di mens iona l a rr a y wit h 26 el ement s coul d b e used t o st or
e t he nu mb er of t i mes ea c h a lpha bet l et t er
oc cur s in a pa ge of t ext , for exa mpl e. A t wo
-
di mensi ona l a rr a y consist s of mu lt ipl e r ows a nd c olu mns i n
whic h p osit i ons a r e ident if i ed b y pa ir s of i ndic es
t he sec ond i ndex i dent if i es t he c olu mn. An exa mp l e wou l d be a r ect a ngu la r arr a
y of nu mb er s
r epr es ent i ngt he mont hl ysa l esma deb ymemb er sofasa lesfor c e
147.
r ecur si ve pr oc ess . A
s ea c h new a ct i va t i on is st ar t ed, t he pr evi ous a ct iva t i on must be set a side. Mor
eover ,
a s ea ch a ct i va t ion is comp l et ed, t he la st a ct iva t ion t ha t wa s set a side must be r
et r i eved. T hus, if t h e
Intr oduct i on t o Com put in g
CS101
VU
P ag e
244
of
3 81
pr op er a ct iva t i on wil l b e on t he t op of t h e
st a ck ea c h t i me a n a ct i va t ion needs t o b e r et r i eved.
A
q ue ue
is a list i n whic h t he ent r i es a r e r emoved onl y a t t he hea d a nd new ent r i es a r e i
ns er t ed onl y a t t he
t a il. An exa mp l e is a line, or qu eu e, of p eopl e w
a it i ng t o buy t ic ket s a t a t hea t er (F igur e 104c)
t he p er so n
a t t he hea d of t he qu eu e is ser ved whil e new a r r iva ls st ep t o t he r ea r (or t a il) of t
he qu eu e. A qu eu e is a
first
-
i n, fi rst
-
o ut,
or
FI FO
a r er emovedfr oma
qu eu e i n t he or der in whi c h t hey wer e st or ed.
ar r ive a t t he buff er ,
t heya r epla ceda t t het a iloft hequ eu e. T hen, whenit comest i met ofor wa r dit emst ot
heir fina ldest i na t i on,
t heya r ef or wa r dedi nt he or der i n whic ht heya ppea r a tt he hea d oft he qu eu e. T hus,
it emsa r ef or wa r dedi n
t he sa me or de
r i n whic h t hey a r r ived.
Fi gure
104
: L i st s, st acks, and queues
CS101
VU
P ag e
245
of
3 81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
Mod ule
148
41. 41.
148.
A
tr ee
isa col l ect i on whos e ent r i es ha vea hi er a r chica lor ga niza t i onsi mi la r t ot ha t ofa n
or ga niza t i onc ha r t
ofa t ypica lcompa ny(F igur e105). T hepr esi dent isr epr es ent eda t t het op, wit hli nesbr
a nchi ngdownt ot he
vic e
pr esi dent s, who ar e foll owed by r egi ona l ma na ger s, a nd so on. T o t his int uit i ve def
i nit i on of a tr ee
st r uct ur ewei mp os eonea ddit i ona lconst r a int , whi c h(i nt er msofa nor ga niza t i
oncha r t )ist ha tnoi ndi vi dua l
i n t he c ompa ny r epor t s t o t wo diff er ent supe
r i or s. T hat is, diff er ent bra nc hes of t he or ga ni za t ion do not
mer ge a t a lower l evel. (W e ha ve a lr ea dy s een exa mp l es of t r ees i n C ha pt er 6
wher e t hey a ppea r ed i n t he
for m of pa r se tr ees. )
Fi gure
105
: An example of anorganizati on chart
Ea ch pos it i on in a t r ee is ca l l ed a
nod e
(F i gur e 106). T he node a t t he t op is ca l l ed t he
root node
( if w e
t ur ned t he dr a wi ng upsi de down, t his node wou l d r epr es ent t he ba se or r oot of t
he t r ee). T he nodes a t t he
ot her ext r emea r e
ca l l ed
t er mi nal no des
( or somet i mes
le af no des
). W e oft enr ef er t ot he nu mb er ofnodes
i n t he l ongest pa t h fr om t he r oot t o a l ea f a s t he
de pt h
of t he t r ee. I n ot her wor ds, t he dept h of a t r ee is t h e
nu mb er of hor iz ont a l la yer s wit hi n it .
Fi gure
106
: T ree t er
mi nol ogy
At t i mes wer ef er t ot r eest r uct ur esa st hough ea c h nodegi vesbir t ht ot hos e nodesi
mm edia t el yb el ow it . In
CS101
VU
P ag e
246
of
3 81
Ifwes el ect a ny nodei na t r ee, we fi ndt ha t t ha t nodet oget her wit ht he nodesb el ow it a
lso
ha s
t hest r uct ur e
ofa t r ee. W eca l lt hes es ma l l er st r uct ur es
subtre es.
T hus, ea chc hi l d nodeist her oot ofa subtr eeb elowt he
is ca ll ed a
br anc h
fr om t he pa r ent . In a bina r y t r ee, we oft en sp ea k of a
CS101
VU
P ag e
247
of
3 81
149.
W e ha ve a lr ea dy encou nt er ed
me mor y a lpha bet ica l l y by t it l e. Alt hou gh conveni ent in ma ny a pplica t ions, t his a
rra ngement ma kes i
t
diff icu lt t o fi nd a l l t he novels b y a pa rt icula r aut hor
Ma ny m
oder n pr ogr a mmi ng la ngua ges i nc lu de p oi nt er s as a pr imit i ve da t a t ype. T ha t
is, t hey a ll ow t he
decla r a t ion, a ll oca t i on, a nd ma nipula t i on of poi nt er s i n wa ys r emi nisc ent of i nt
eger s a nd c ha r a ct er str ings.
Us i ng suc h a la ngua ge, a pr ogr a mmer ca n desi gn ela bo
Fi gu r e
107
: N ovel s arranged byt i tl e but l i nked according t o aut horshi p
CS101
VU
P ag e
248
of
3 81
150.
T he t er m
d at abas e
r ef er s t o a col l ect i on of da t a t ha t is mult i di mens i ona l in t he s ens e t ha t int er na
l l inks
bet ween it s ent r i es ma ke t he i nf or ma t ion a cc ess ibl e fr om a va r i et y of p er spect i
ves. T his is i n cont r a st t o a
t ra dit i ona l f il e s yst em, somet i mes ca ll ed a
flat fi le,
whi
c h is a one
-
di mensi ona l st or a ge syst em, mea ni ng
t ha t it pr es ent sit si nf or ma t ionfr oma si ngl ep oi nt of vi ew. Wher ea sa fla tfil ec ont a i
ni ngi nf or ma t i ona bout
comp os er s a nd t heir c omp os it i ons mi ght pr ovi de a l ist of c omp osit i ons a rra
nged b y c omp os er , a da t
a ba se
mi ght pr es ent a ll t he wor ks by a singl e comp os er , a ll t he c omp os er s who wr ot e a
pa rt icula r t yp e of mus ic,
Fi gure
108
: A f il e vers us a database organi zati on
CS101
VU
P ag e
249
of
3 81
CS101
VU
P ag e
250
of
3 81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
151.
Amongt he disa dva nt a gesoft hepr ol if er a t i onofda t a ba set ec hnol ogyist hepot ent ia
lofsens it i ve da t abei ng
or sa les r ec or ds.
T hus ,
T opr ovi de diff er ent us er sa ccess t odiff er ent i nfor ma t i on wit hi na da t aba se, da ta
basesyst emsoft enr el y on
schema s a nd subs chema s. A
sc he ma
is a
a t a ba se wou l d
i ndi ca t et ha t ea c hst udent r ec or dc ont a inssuc hit emsa sthecur r ent a ddr ess a
ndphonenu mb er oft ha t st udent
ult y
r ec or ds does not i nc lude emp l oyment hist or y. Under t his subschema , t he r egist r ar
could f ind out whi c h
s of t he st udent s
a dvis ed by t ha t per son.
VU
P ag e
251
of
3 81
152.
a n a pplica t i on la yer a nd a da ta ba se
ma na gement la yer (F i gur e 109). T he a ppli ca t ion s oft wa r e
ha ndl es t he c ommu ni ca t ion wit h t he us er of t he da t a ba se a nd ma y b e qu it e c
ompl ex, a s exemp li fi ed b y
a pplica t i onsi nwhic hus er sa ccess a da t a ba sebymea nsofa websit e. I nt ha t ca set
heent ir ea ppli ca
t ionla yer
cons ist s of c l i ent s t hr ou ghout t he I nt er net a nd a ser ver t ha t uses t he da t a ba se
t o fi l l t he r equ est s fr om t he
cl i ent s.
Fi gure
109
: T he concept ual l ayers of a dat abase i mpl ement at i on
ba se. T he a ct ua l ma nipu la t i on of
t he da t a base is a ccompl is hed b y t he
dat ab ase man age me nt sys te m (DB MS ).
Onc e t he a pp li ca t io n
soft wa r e ha s det er mined wha t a ct ion t he user
is r equ est i ng, it uses t he DBMS a s a n a bstr a ct t ool t o obt a i n
t he r esu lt s. If t he r equ est is t o a dd or del et e da t a , it is t he DBMS t ha t a ct ua ll y
a lt er s t he da t a ba se. If t he
r equ est is t o r et r i eve i nf or ma t i on, it is t he D BMS t ha t per f or ms t he r equ ir ed s
ea r c
hes.
T hisdic hot omyb et weent hea pplica t i ons oft wa r ea ndt heD BMS ha ssev
-
S t illa not her r ea sonf or sepa r a t ingt heus er i nt er fa c ea nda ct ua lda t ama nipu la t
ioni nt ot wodi ff er ent soft wa r e
la yer s is t o a chi eve
d at a i nd epe nd e nce
CS101
VU
P ag e
252
of
3 81
cha nges t o t he pa yr ol l pr
news l et t er .
CS101
VU
P ag e
253
of
3 81
153.
a ll owing t he us er of t he da t a ba se t o i ma gi ne t ha t t he
i nf or ma t i on st or ed i n t he da t a ba se is arr a nged in a
mor e useful for ma t . In pa rt icula r , a DBMS cont a ins r out ines t ha t tr a nsla t e comma
nds st a t ed i n t er ms of a
conc ept ua lvi ew oft heda t a ba seint ot hea ct i onsr equ ir edbyt hea ct ua lda tast ora
gesyst em. T his
conc ept ua l
vi ew of t he da t a ba se is ca ll ed a
dat abas e mo de l.
-
110
, t uples cons ist of t he i nf or ma t i on a bout a pa rt icula r employee. C olu mns i n a r
ela t i on a r e r ef er r ed t o a s
att r ib utes
b eca us e ea ch ent r y i n a colu mn descr ib es some c ha r a ct er ist ic, or a t tr ibut e, of t
he ent it y
r epr es ent ed by t he c or r espondi ng t upl e.
Fi gure
110
:A
rel ati on contai ni ng empl oyee i nf ormat i on
CS101
VU
P ag e
254
of
3 81
154.
Api vot a lst epindesi gni ngar ela t i ona lda t a ba seist odesignt her ela t ions ma ki ng
upt heda t a ba se.Alt hou gh
t his mi ght a ppea r t o be a simp l e t a sk, ma ny subt l et i es a r e wa it i ng t o t ra p t he
unwa r y des i gner .
posit i on
.)
Onea ppr oa cht ot hispr obl em ist o ext endt her ela t i oni nF igur e110t oinc lu det hes ea t
t r ibut esa sa ddit i ona l
colu mns i n t he t a bl e, a s shown i n F i gur e 111. Howev er , cl os e exa mi na t ion of t he
r esult r evea ls sever a l
pr oblems. One isa la ckof eff ic i enc yd
u et or edu nda nc y. T her ela t ion nol onger c ont a ins onet uplef or ea c h
emp l oyee but ra t her one t upl e for ea ch a ss ignment of an empl oyee t o a job. If a n
empl oyee ha s a dva nc e d
i nt hecompa nyt hr ou ghasequ enc eofs ever a ljobs, seve r a lt uplesi nt henewr ela t io
n must cont a i nt hesa me
i nf or ma t ion a bout t he emp loyee ( na me, a ddr ess , ident i fica t i on nu mb er , a nd S
oc ia l S ecur it y nu mb er ). F or
exa mp l e, t he p er sona l i nf or ma t ion a bout Ba ker a nd S mit h is r ep ea t ed b eca us e
t hey ha ve hel d mor e t ha n
one j ob. Mor eover , when a pa
r t icula r posit i on ha s been hel d b y nu mer ous empl oyees, t he depa r t ment
a ss ocia t ed wit h t ha t job a l ong wit h t he a ppr opr ia t e ski l l code must be r ep ea t ed
i n ea c h t upl e r epr es ent i ng
a na ssignment oft he j ob. F or exa mp l e, t he descr ipti on oft hef l oor ma na ger j ob
Fi gure
111
: A rel ati on contai ni ng redundancy
Anot her , per ha ps mor e ser i ous, pr obl em wit h our ext ended r ela t i on sur fa ces
when
CS101
VU
P ag e
255
of
3 81
Fi gure
112
: An empl oyee dat abase consi sti ng of three rel at i ons
CS101
VU
P ag e
256
of
3 81
155.
VU
P ag e
257
of
3 81
156.
NE W <
-
T hes ema nt i csoft hisst a t ement ist ocr ea t ea newr ela t i onca l l edNEWc ont a ini ngt
hos e
t upl es(t her eshou l d
beonl yonei nt hisca s e)fr omt her ela t i onEMP LOYEEwhos eE mp lI da t t r ibut eequa ls34
Y70(F i gur e113).
Fi gure
113
: T he SEL ECT operat i on
Intr oduct i on t o Com put in g
CS101
VU
P ag e
258
of
3 81
Mod ule
157
50. 50.
157.
Inc ont r a st t ot heS ELEC Toper a t ion, whi c hext r a ct sr owsfr oma r ela t i on, t heP R
OJECTop er a t ion ext r a ct s
colu mns. S uppose, for exa mpl e, t ha t in sea r chi ng f or t he j ob t it l es i n a cer t a in
depa r t ment , we ha d a lr ea dy
sel ect ed t he t uples fr om t he JOB r ela t i on t ha t per t a ined t o t he t ar get depa r t
ment a nd pla c ed t hes e t upl es in
a new r ela t ion ca ll ed NEW1. T he l ist we a r e s eeki ng is t he JobT it l e c olu mn wit hi
n t his new r ela t ion. T he
P R OJECT oper a t ion a ll ows ust o ext r a ct t hi
s colu mn ( or colu mns if r equir ed) a nd pla c e t he r es u lt in a new
r ela t i on. We expr ess such a n op er a t ion a s
NE W2 <
-
ca nb eusedt oobt a i na list ing oft he na mesa nda ddr ess es ofa l l emp l oyees. T hisl ist is
int he newl ycr ea t ed
(t wo
-
c olu mn) r ela t ion ca l l ed M AIL (F i gur e 114).
Fi gure
114
: T he PROJEC T operat i on
CS101
VU
P ag e
259
of
3 81
158.
Anot her op er a t ionus edi nc onju nct i onwit hr ela t i ona lda ta basesist heJOINop er a t
ion. It isusedt oc ombi n e
diff er ent r ela t ions i nt o one r ela t i on. T he JOIN of t wo r ela t i ons pr odu c es a new r
ela t i on whos e a t t r ibut es
cons ist oft hea t t r ibut esfr omt he or i gi n
a lr ela t i ons(F i gur e115). T he na mes oft hes ea t t r ibut esa r et hesa me
a s t hos e i n t he or igi na l r ela t i ons ex c ept t ha t ea ch is pr ef ix ed by t he r ela t i on of
it s or igi n. (If r ela t i on A
cont a i ni ng a t t r ibut es V a nd W is JOIN ed wit h r ela t i on B cont a i ning a t t r ibut e
s X, Y, a nd Z, t hen t he r esu lt
ha sfivea t t r ibut esna medA. V, A. W, B. X,B. Y, a ndB. Z. )T hisna mi ngc onvent i onensur
est ha tt hea t tr ibut es
i n t he new r ela t i on ha ve u niqu e na mes, even t hou gh t he or i gi na l r ela t i ons mi ght
ha ve a t t r ibute na mes i n
com mon. T het u
pl es (r ows) oft he newr ela t i ona r epr oduc edbyc onca t ena t i ngt upl esfr omt het woor i
gi na l
r ela t i ons (s ee a ga i n F i gur e 115). Whi c h t upl es a r e a ctua ll y j oi ned t o f or m t upl
es i n t he new r ela t i on i s
det er mi ned b y t he condit i on u nder whic h t he JOIN is
const r uc
t ed?
C<
-
Fi gure
115
: T he Joi n Operat i on
CS101
VU
P ag e
260
of
3 81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
C<
-
JO IN A
and B wher e A. W <B .X
NE W1 <
-
JO IN ASS IG NME NT and JO B
th
a t pr odu c es t he r ela t i on NEW1, a s shown i n F i gur e 117. Fr om t his r ela t ion, our
pr obl em ca n b e sol ved
NE W1 <
-
JO IN ASS IG NME NT and JO B
NE W2 <
-
L IST
<
-
CS101
VU
P ag e
261
of
3 81
Fi gure
117
: An appl i cat i on of t he JOIN operat i on
Intr oduct i on t o Com put in g
CS101
VU
P ag e
262
of
3 81
159.
Fi gure
118
: T he associ at i ons bet ween obj ect s i n an object
-
ori ent ed dat abase
a r equir ement t ha t mi ght seem ob vious but is i nher ent ly dist i nct fr om t he ma
nner i n whi c h ob j ect s ar e
nor ma l ly t r ea t ed. Nor ma l l y, w
hen a n ob j ect
-
or i ent ed p r ogr a m is ex ecut ed, t he object s cr ea t ed dur ing t h e
CS101
VU
P ag e
263
of
3 81
a ft er t he pr ogr a m t ha t cr ea t ed
t hem t er mi na t es. S uch ob j ect s a r e sa id t o b e
p ers iste n t.
T hus ,
P r oponent s of ob j ect
-
or i ent ed da t a ba ses off er nu mer ous a r gument s t o show why t he obj ect
-
or i ent ed
a ppr oa ch t o da t a ba se desi gn is bet t er t ha n t he r ela t iona l a ppr oa ch. One is t ha t
t he obj ect
-
or i ent ed a ppr oa ch
a ll ows t he ent ir e soft wa r e sys
-
t em (a pplica t i on s
oft wa re, DBMS ,a nd t he da t a ba se it sel f) t o be des igned i n
t he sa me pa r a digm. T his is in c ont r a st t o t he hist or ica ll y c ommon pr a ct ic e of usi
ng a n i mp er a t i ve
pr ogr a mmi ng la ngua ge t o devel op a ppl ica t i on soft wa r e for int er r oga t i ng a r ela
t i ona l da t a ba se. Inher e
nt i n
such a t a sk is t he cla sh b et ween i mp er a t i ve a nd r ela t i ona l par a digms. T his dist
inct i on is subt l e a t our l evel
of
st udy,
usedt or et r i evea nobj ect r epr es ent i nga mot i onpi ct ur ebeca uset hedist i nct i onsint
yp eca nb ehi ddenw
it hi n
t he obj ect s i nvol ved.
T hus,
t he ob j ect
-
or i ent ed a ppr oa ch a ppea r s t o be mor e c ompa t ibl e wit h t h e
const r uct i on of mu lt i media da t a ba ses
t ion. Inst ea d,
we c ou l d mer ely a sk t he a ppr opr ia t e emp l oyee obj ect t o r epor t it s job hist or y. T
his a bil it y t o const r uct
da t a bases whos e c omp onent s r espond i nt el l i gent l y t o inqu ir i es off er s a n ex cit i
ng a rr a y of poss ib i lit i es
beyond t hos e of mor e t r a dit i ona l
CS101
VU
P ag e
264
of
3 81
160.
Inexp ens i ve da t a ba se ma na gement syst ems f or per sona l use a r e r ela t ivel y s i mp
l e s yst ems. T hey t end t o
ha ve a si ngl e ob j ect i ve
pr obl ems such a s op er a t ions t ha t for some r ea son a r e onl y pa r t ia lly c ompl et ed
or diff
er ent op er a t ions t ha t
mi ght i nt er a ct ina dver t ent l y t o ca use ina ccur a t e i nf or ma t ion i n t he da t a ba se.
CS101
VU
P ag e
265
of
3 81
161.
In t he ca s e of la r ge da t a ba ses t ha t ar e
subj ect t o hea vy tr a nsa ct ion l oa ds, it is hi ghl y l i kel y t ha t a r a ndom
sna pshot wi ll f i nd t he da t a ba se i n t he mi ddl e of s ome t r a nsa ct ion. A r equ est f or
t he ex ecut i on of a
t ra nsa ct ion or a n equ ip ment ma lfu nct i on wi l l t her efor e li kel y oc cur a t a t i me
when t he
da t a base is i n a n
i nc onsist ent st a t e.
R ol lba cks of t r a nsa ct ions a r e not r est r ict ed, howeve r , t o t he pr oc ess of r ecover
i ng fr om equip ment
CS101
VU
P ag e
266
of
3 81
162.
T o sol ve su ch pr obl ems, a DBMS coul d f or c e t r a nsa ct i ons t o ex ecut e i n t heir ent
ir et y on a one
-
at
-
a
-
t i me
ba sisbyhol di ng ea c hnewt r a nsa ct ion i na qu eu eunt i lt hos epr ec eding it ha ve c omp l
et ed. But a t ra nsa ct ion
oft en spends a lot of t i me wa it i ng for
ma ss st ora ge oper a t ions t o be p er for med. By i nt er
-
wea ving t he
ex ecut i on of t r a nsa ct ions, t he t i me dur i ng whi c h one t r a nsa ct ion is wa it ing ca n
be us ed b y a not her
t ra nsa ct ion t o pr oc ess da t a it ha s a lr ea dy r et r i eved. Most la r ge da t a ba se ma
na gement syst ems t
her ef or e
cont a i n a schedu l er t o c oor di na t e t i me
-
sha r i ng a mong t r a nsa ct ions i n mu c h t he sa me wa y t ha t a
mult ipr ogr a mmi ng op er a t ing syst em c oor di na t es i nt er wea vi ng of pr oc ess es.
s har ed loc k s
a nd
excl us ive loc ks.
T hey cor r esp ond t o t he t wo
t yp esofa cc ess t oda t a t ha ta t ra nsa ct ionmi ght r equir e
sha r eda cc ess a ndex clus i vea cc ess . Ifa t ra nsa ct ion
is not goi ng t o a lt er a da t a it em, t hen it r equir es sha r ed a cc ess , mea ning t
ha t ot her t ra nsa ct ions a r e a lso
a ll owed t o vi ew t he da t a. However , if t he t r a nsa ct ion is goi ng t o a lt er t he it em,
it must ha ve exc lus i ve
a ccess , mea ni ng t ha t it must be t he only t r a nsa ct ion wit h a cc ess t o t ha t da ta .
In a loc ki ng pr ot oc ol, ea ch t i me a tr a ns
a ct ion r equ est s acc ess t o a da ta it em, it must a lso t ell t he DBMS t he
t yp eofa ccess it r equ ir es. Ifa tr a nsa ct ionr equ est ssha r eda cc ess t oa nit emt ha t iseit
her unl oc ked or loc ke d
wit h a shar ed l oc k, t ha t a ccess is
gra nt ed,
a nd t he it em is ma r ked wit h a
ma nner , a t ra nsa ct iont ha t isgoi ngt oa lt er da ta prot ect st ha t da ta fr omot her t ra nsa
ct ionsbyobt a ini ng
ex clus i ve a cc ess , wher ea s sever a l t r a nsa ct ions ca n s ha r e a cc ess t o a n it em if
none of t hem a r e going t o
cha nge it . Of cour s e, onc e a t r a nsa ct ion is f
i nis hed wit h a n it em, it not if i es t he D BM S , a nd t he a s s oc ia t e d
l oc k is r emoved.
t hen i ns
ist s on wa it i ng f or t he ot her . T o a voi d such dea d
-
CS101
VU
P ag e
267
of
3 81
known a s t he
wo und
-
w ait proto col
( ol d t ra nsa ct ions wou nd you ng t r a nsa ct ions, you ng t ra nsa ct ions wa it
for old ones), ensur e
s t ha t ever y t r a nsa ct ion wil l ult i ma t el y be a l l owed t o c omp l et e it s t a sk.
CS101
VU
P ag e
268
of
3 81
163.
A
se q ue nt i al fi le
is a fil e t ha t is a cc ess ed i n a ser ia l ma nner fr om it s begi nni ng t o it s end a s t hou
gh t h e
i nf or ma t ion i n t he f il e
wer e a rr a nged in one l ong r ow. Exa mp l es i nc lu de a udi o f il es, vi deo f il es, f i l es
cont a i ni ng pr ogr a ms, a nd fil es cont a i ni ng t ext ua l docu ment s. In fa ct , most of t
he f il es cr ea t ed by a t ypica l
per sona l c omput er user ar e sequ ent ia l f i l es. F or inst a nc e, when a s
pr ea ds heet is sa ved, it s inf or ma t ion i s
enc odeda ndst or eda sasequ ent ia lfi l efr om whi c ht hes pr ea ds heet a pplica t i onsoft
wa r eca nr ec onst r uct t he
spr ea dsheet .
-
c ha r a ct er
wou l
d be a l ong st r ing of enc oded c ha r a ct er s in whi ch ea c h 31
-
c ha r a ct er bloc k r epr es ent s t he i nf or ma t i on
a bout a singl e emp l oyee (F i gur e 119). Infor ma t i on wou ld b e r et r i eved fr om t he f
i l e i n t er ms of l ogica l
r ec or ds c onsist ing of 31
-
c ha r a ct er bloc ks. Wit hin ea
c h of t hes e b l oc ks, i ndi vi dua l fi el ds wou l d be i dent i
-
Fi gure
119
: The st ruct ure of a si mpl e empl oyee f il e i mpl ement ed as a t ext fi l e
CS101
VU
P ag e
269
of
3 81
t hesect or sint hepr op er sequ enc ea st hou ght hefi l ewer est or eds equ ent ia l l y, event
hou ght hefi l eisa ct ua ll y
di
st r ibut ed over va r i ous por t ions of t he dis k.
Inher ent i npr ocess i ngasequ ent ia lfi l eist he needt odet ect whent he end oft hefi l eisr ea
ched. G ener ica l l y,
we r ef er t o t he end of a sequ ent ia l fi l e a s t he
e nd
-
of
-
fil e (E O F).
T her e a r e a var i et y of wa ys of
i dent if yi ng
t he EOF . One is t o pla ce a spec ia l r ec or d, ca ll ed a
senti ne l,
a t t he end of t he fi l e. Anot her is t o use t he
(na me, emp l oyee i dent if ica t i on nu mb er , pa y sca le, a nd so on) fr om whi ch c hecks
must be pr int ed on a
CS101
VU
P ag e
270
of
3 81
164.
Dat ab ase S yste ms: I nde xed Fi les
st or ed. However , suchfil esa r ei neff i ci ent whenr ec or dswit hi nt hef il emust b er et r
ievedin
a nunpr edi ct a bl e
or der . Insuc hsit ua t i onswha t isneededisa wa yt oi dent i fyt hel oca t i onoft hedes ir edl
ogica lr ec or dqui c kl y.
A p opula r solut i on is t o us e a n i ndex f or t he f i l e i n mu ch t he sa me wa y t ha t a n i
ndex i n a book is us ed t o
l oca t e t op ics wit h
i n t he b ook. S uch a fil e s yst em is ca l l ed a n i ndex ed f i l e.
Ani ndexfor afil econt a i nsalist oft hekeysst or edint hefi l ea l ong wit hent r i esi ndi ca t i
ng wher et her ecor d
cont a i ni ng ea ch key is st or ed. T hus t o find a pa rt icula r r ec or d, one f i nds t he i den
t if yi ng key i n t he i ndex
a nd t hen r et r i eves t he bl ock of i nf or ma t i on st or ed a t t he loca t i on a ss oc ia t ed
wit h t ha t key.
t o a void l engt hy sea r ches when you a r e r et ri evi ng a n indi vi dua l r ec or d. In par t
icula r , ift he fil e
b er is kno wn. Anot her exa mpl e is foun dona udi o
C Ds wher e a n i ndex is used t o a l l ow r ela t ivel y qui ck a c c ess t o i ndi vi dua l r ec or
di ngs.
Fi gure
120
: Openi ng an i ndexed f il e
Over t he yea r s
nu mer ous va r ia t ionsoft heba sic i ndexc onc ept ha veb eenus ed. Oneva r ia t ion c onst r
uct sa n
i ndex i n a hi er ar chi ca l ma nner so t ha t t he i ndex t a kes on a la yer ed or tr ee st r
uct ur e. A pr omi nent exa mp l e
is t he hi er a r chica l dir ect or y syst em us ed b y most op er a t in
g syst ems for or ga niz i ng f i l e st or a ge. I n suc h a
ca se, t he dir ect or i es, or fol der s, pla yt her ol e of i ndex es, ea c hc ont a i ni ng li nkst oit
ssub
-
i ndex es. F r omt his
per sp ect i ve, t he ent ir e f i l e syst em is mer el y one la r ge i ndex ed f i l e.
CS101
VU
P ag e
271
of
3 81
165.
Dat ab ase
S yste ms: H as h Fi les
Alt hou gh i ndex i ng pr ovi des r ela t ivel y qu ic k a ccess t o ent r i es wit hi n a da ta st or
a ge st r uct ur e, it does so a t
t he exp ens e of i ndex ma i nt ena nc e.
H as hi ng
is a t ec hniqu e t ha t pr ovi des si mi la r a ccess wit hout such
over hea d. As in t he ca s e of
va lu es
t obucket nu mb er sisca l l eda
has h func tio n.
)Ea chr ec or disst or edi nt hebu cket i dent ifi edb yt hispr oc ess .
T her ef or e, a r ec or d t ha t ha s been p la c ed i n t he st or a ge st r uct ur e ca n b e r et r i
eved b y fir st a pplyi ng t he ha s h
a
has h t abl e.
CS101
VU
P ag e
272
of
3 81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
166.
E xamp l e
ma s s st or a ge t ha t wil l
pla y t he r ol e of buc ket s. T he nu mb er of buc ket s a nd t he s iz e of ea c h bucket a r e
desi gn dec is i ons t ha t we
wi ll c onsi der la t er . F or now, let us a ss ume t ha t we ha ve cr ea t ed 41 bucket s,
whic h we r ef er t o a s bucket
nu mb er 0, bucket nu mb e
r 1, t hr ough bucket nu mb er 40. (T he r ea s on we s el ect ed 41 bucket s r a t her t ha n
an
even 40 wi l l be exp la i ned shor t l y. )
is t o devel op a ha sh fu nct i on f or conver t i ng t hes e keys i nt o buc ket
t her ef or enot nu mer ic, t heya r est or eda sbit pa t t er ns, a ndweca ni nt er pr et t hebit
pa t t
er nsa snu mb er s. Usin g
t his nu mer ic i nt er pr et a t ion, we ca n di vide a ny key b y t he nu mb er of buc ket s a va
i la bl e a nd r ec or d t he
r ema i nder , whic h i n our ca se wi ll b e a n i nt eger i n t he r a nge fr om 0 t o 40. T hus
we ca n us e t he r ema i nder
of t his divisi on pr oc ess t o
Fi gure
121
: Has hi ng t he key f i el d val ue 25 X3Z
t o one of 41 bucket s
s t or a ge a r ea i nt o 41 bu cket s . F ir s t , not e t ha t t o
obt a i n a n eff ic i ent ha sh syst em, t he r ecor ds being st or ed shoul d b e dist r ibut ed
evenl y a mong t he bucket s.
Ifa dispr opor t i ona t enu m
-
t or s of 40.
CS101
VU
P ag e
273
of
3 81
Fi gure
122
: T he rudi me
nt s of a hashi ngsyst em
CS101
VU
P ag e
274
of
3 81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
167.
Da t a mi ni ng a ct i vit i es diff er fr om t r a di
t i ona l da t a ba se i nt er r oga t i on i n t ha t da t a mi ni ng s eeks t o i dent if y
pr evi ous ly u nknown pa t t er ns a s oppos ed t o t r a dit i ona l da t a base i nquir i es t ha t
mer ely a sk f or t he r et r i eva l
of st or ed fa ct s. Mor e
-
ca ll ed
data w are ho uses,
t i est ha t dist i ngu ish cust omer s whos hop for us edca r sfr omt hos e
who shop f or new ones.
CS101
VU
P ag e
275
of
3 81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
168.
E xamp l es and I mp li c at io ns
a 4
-
to
-
0 a ge gr oup
a nd a 25
-
to
-
40 a ge gr oup. (P er ha ps t he mot i on pict ur e a t t ra ct ed c hi ldr en a nd t heir par ent
s?)
O ut l ie ranalys is
isa not her f or
mof da t a mi ni ng. It t r ies t oi dent if y da t a ent r i es t ha t do not c omp l y wit ht h e
nor m. Out li er a na lysis ca n be used t o i dent if y er r or s in da t a coll ect i ons, t o ident
if y cr edit ca r d t heft by
F ina l l y, t he for m of da t a mi ni ng ca ll ed
seq ue nt i al pat ter n analys is
t r ies t o ident if y pa t t er ns of beha vi or
over t i me. F or exa mpl e, s equ ent ia lpa t t er na na lys is mi ght r evea lt r
endsi n ec onomics yst emssuc ha sequ it y
ma r ket s or i n envir on
-
oft heda t a, a swit ness edbyt heus eofda t a mi ningi nunr a vel i ngt hemyst er i esofDN A. I
na nyca s e,
t hescop eofda t a mi ni nga pplica t i onsispot ent ia ll yenor mous, a ndt husda t a mi ni ngpr
omis est obea na ct iv e
a r ea of r esea r ch f or yea r s t o come. Not e t ha t da t a ba se t ec hnol ogy a nd da t a mi
ni ng a r e cl os e c ous i ns, a nd
t hus r es ea r ch i n one wi l l ha ve
t het er m
cube
isusedt oconj ect ur et hei ma geofmu lt ipl e
di mens i ons )t ha t ma keda t a mi ni ng
poss ib l e. I n t ur n, a s r esea r cher s i n da t a mi ni ng i mpr ove t ec hni qu es f or i mp l
ement i ng da t a cubes, t hes e
r esult s wi ll pa y di vi dends i n t he f i el d of da t a ba se des i gn.
hi gh
nu mb er of wi nni ng l ot t er y t ic ket s s houl d pr oba bl y not be c ons i der ed si gnif ica
nt t o s omeone p la nni ng t o
buy a lot t er y t ic ket , but t he disc over y t ha t cust omer s who buy sna ck food a lso t end
t o buy fr oz en di nner s
mi ght c onst it ut e mea ni ngful i nf or ma t i ont
oa gr oc er yst or e ma na ger . Likewis e, da t a mi ni ng enc ompa ss esa
va st nu mb er of et hica l iss u es i nvol vi ng t he r i ght s of i ndivi dua ls r epr es ent ed i n t
he da t a wa r ehous e, t he
a ccur a cy a nd use of t he c onc lusi ons dr a wn, a nd even t he a ppr opr ia t eness of da t a
mi ni ng i
n t he f ir st pla ce.
CS101
VU
P ag e
276
of
3 81
169.
Wit h t he devel op ment of da t a base t echnol ogy, infor ma t i on t ha t wa s onc e bur ied
i n a r ca ne r ec or ds ha s
bec ome a cc ess ib l e. In ma ny ca ses, a ut oma t ed l ibr a r y syst ems p la c e
t
a genc i es, pol it i ca l pa r t ies, emp l oyer s, a nd pr i va t e i ndi vi dua ls.
In s
ome
ca ses,
t he da t a col l ect i on pr oc ess is r ea di ly a ppa r ent ; in ot her s it is subt le. Exa mpl es
of t he fir st
ca se occur when one is exp l ic it l y a sked t o pr ovi de i nfor ma t i on. T his ma y b e done
i n a volu nt a r y ma nner ,
a s in sur veys or cont est r egist r a t ion f or ms, or it ma y b
e done i n a n involu nt a r y ma nner , such as whe n
pr ovi di ngp er sona li nf or ma t ionwhena ppl yi ngf or a loa nvolu nt a r yor i nvolu nt a r
y?T hedist i nct i ondep ends
on whet her r ec ei ving t he l oa n is a conveni enc e or a nec ess it y. T o use a cr edit ca r
d a t some r et a i l er s now
r equir est ha t youa llowyour signa t ur et ober ecor dedi na digit i z edfor ma t . Aga i n, pr
ovi di ngt hei nf or ma t i on
is eit her volu nt a r y or involu nt a r y dep en
di ng on your sit ua t ion.
Mor esubt l eca sesofda t acol l ect i ona voi ddir ect commu nica t i onwit ht hesubj ect . Exa
mpl esi nc lu dea cr edit
compa ny t ha t r ec or ds t he pur c ha si ng pr a ct ices of t he holder s of it s cr edit ca r ds,
websit es t ha t r ecor d t h e
i dent it i es of t ho
s e who vis it t he s it e, a nd socia l a ct ivist s who r ecor d t he l ic ens e pla t e nu mb er s
on t he ca r s
c a ses,
cha ses
a r ec or d whos e va lu e fa r exc eeds t he va lu e of t he disc ou nt s a wa r ded.
r evea l i nf or ma t i on t ha t wou l d
ot her wis er ema i nobscur e. F or exa mpl e, t hepur cha si ngpa t t er nsofcr edit ca r dhol
der sca nbec la ss if i eda nd
cr oss
-
l ist edt o obt a i ncust omer pr of il esofi m mens e ma r ket i ngva lu e. S ubscr ipt i onf or
msf or body
-
bui l di ng
ma ga zi nes c
a n b e ma i l ed t o t hos e who ha ve r ec ent l y pur cha sed ex er cis e equ ip ment , wher ea
s subs cr ipt ion
for ms for dog ob edi enc e ma ga z ines ca n be t a r get ed t owa r d t hos e who ha ve r ec
ent l y pur cha sed dog food.
Alt er na t i ve wa ys of comb i ni ng i nf or ma t i on ar e somet i mes ver y i ma
gi na t i ve. Welfa r e r ec or ds ha ve bee n
compa r ed t o cr i mi na l r ec or ds t o f i nd a nd a ppr ehend pa r ol e viola t or s, a nd i n
1984 t he S el ect i ve S er vic e i n
t he Unit ed S t a t es used old b ir t hda y r egist r a t ion list s fr om a popu la r ice cr ea m r
et a i l er t o i dent if y c it i z ens
who
ha d fa il ed t o r egist er for t he mi l it a r y dr a ft .
CS101
VU
P ag e
277
of
3 81
of
bur ea ucr a cy.
But
a s tar kcont r a s tt ot he
ext ended t i me p er i ods a ss ocia t ed wit h l ega l pr oc ess es.
Ofc our se, i n ma nyca ses da t a basea ppli ca t ionsa r eb enefic ia lt obot ht he hol der a ndt
hesubj ect oft he da t a ,
but in a ll
ca ses,
t her e is a loss
CS101
VU
P ag e
278
of
3 81
170.
Arti fic i al Inte ll ige nc e: I ntro d uc tio n and Vis io n
ma chi nes
t ha t ca ncarr yout comp l ext a skswit hout hu ma ni nt er ve nt i on. AI ishelpi ngt o ma keR
ob ot sa sshowni nt he
F igur e 123, a nd s el f
-
dr i vi ng ca r sa s shown
i n t he F i gur e 124.
Fi gur e
123
: Robot
Fi gure
124
: Sel f
Dri vi ngC ars
R obot s ca n help pa t i ent s, for exa mp l e one t yp ica l r ob ot shown i n t he F i gur e 125
ca n a ll evia t e a per son
even 40 t i mes a da y.
Intr oduct i on t o Com put in g
CS101
VU
P ag e
279
of
3 81
Fi gure
125
: Medi cal robot hel pi ng t he pat i ents
P epp er R obot wor ks a s r ec ept i onist in B el gia n hosp it a l shown i n t he F i gur e 126.
Fi gure
126
: Recept i oni st Robot
Anot her r obot isshowni nt heF igur e127.T hisr obot isa blet ot a kebloodfr omt hevei nsoft
he hu ma nsa nd
it is mor e a ccura t e t ha n hu ma ns. It per for ms i ma ge pr oc ess i ng t o loca t e t he vei
ns a nd fur t her conf ir med b y
t he ult r a sound.
CS101
VU
P ag e
280
of
3 81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
Fi gure
127
: Robot draws blood
CS101
VU
P ag e
281
of
3 81
171.
An
age nt
In some
ca s es,
devel op i ng
pro ced ur al knowl edge
da t a base of knowl edge (t her e is st il l just one out , but now r unner
s ar e on f ir st a nd s ec ond) fr om whic h
r at iona l r esp ons es t o futur e event s a r e det er mi ned.
T ha t is, a n a gent must b e a bl e t o ext r a ct inf or ma t ion fr om t
he da t a pr oduc ed b y it s sens or s, or in ot her
wor ds, a na gent must be a ble t o per c ei ve. In some
ca s es,
ar ea s of
r es ea r ch. T he a gent a t tr ibut es t ha t we ha ve i dent if i ed her e r epr es ent pa st a s
wel l a s cur
-
r ent ar ea s of
r es ea r ch. Of cour se, t hey a r e not t ot a ll y i ndep endent of ea c h ot her . We woul d li
ke t o devel op a gent s t ha t
poss ess a lloft hem, pr oduc inga gen
t st ha t under st a ndt heda t a r ec ei vedfr omt heir envir onment sa nddevel op
t ies.
CS101
VU
P ag e
282
of
3 81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
However , byis ola t i ngva r ioust yp esofr a t iona lb eha vi or a ndpur suingt hemindep end
ent ly, r es ea r cher sga i n
a t oehol d t ha t ca n la t er be c omb i ned wit h pr ogr ess i n ot her a r ea st o pr oduc e
mor e i nt ell i gent a gent s.
11. 2 a nd 11. 3. T he a ge
nt is des i gned t o sol ve t he ei ght
-
puzzl e, whic h c ons ist s of ei ght squa r e t il es la bel ed
1t hr ough8mou nt edi nafra meca pa bleofhol di nga t ota lofni nesucht i l esint hr eer owsa
ndt hr eec olu mns
(F igur e 128). Among t he t i l es i n t he fr a me is a va ca ncy int o
Fi gure
128
: T he ei ght
-
puzzl ei n it ssol ved confi gurat i on
Our a gent t a kes t he f or m of a box equ ipp ed wit h a gr ipper , a vi deo ca mer a , a nd
a fi nger wit h a r ubber en d
so t ha t it does not sl ip when pushi ng somet hi ng (F i gur e 129). When t he a gent is f ir
st t ur ned on, it s gr ipp er
begi nst oop ena ndcl os ea sifa ski ngf or t hepuz zl e. W henwepla c ea scr a mbl edei ght
-
pu zz l ei nt hegr ipp er ,
t he gr ipp er cl os es on t he puz z l e. Aft er a shor t
t i me,
t il es a r ound i n
t he fr a me u nt i l t hey a r e ba ck in t heir or i gi na l p osit ions. At t his poi nt t he ma c hi
ne r el ea s es
t he puzz l e a nd t ur ns it self of f.
T his puzzl e
-
s ol vi ng ma c hi ne ex hib it s t wo of t he a gent a t tr ibut es t ha t we ha ve i dent if i ed. F
ir st, it must be
a ble t o p er c ei ve i n t he s ens e t ha t it must ext r a ct t he cur rent puzz l e st a t e fr om
t he i ma ge it r ec ei ves fr om it s
ca mer a .
CS101
VU
P ag e
283
of
3 81
Fi gure
129
: Our pu zz l e
-
sol vi ng machine
VU
P ag e
284
of
3 81
172.
st a ndi ng of a ni ma l
esp ec ia ll y hu ma n
i nt el l i genc e. T hi
s di chot omy is cla r if i ed by cons ider i ng t he
ma nner in whic h t he t wo t r a cks ar e pur sued. T he engi neer ing a ppr oa ch l ea ds t o a
per for ma nc e
-
or i ent e d
met hodol ogyb eca uset heunder l yi nggoa list opr oduc ea pr oduct t ha t meet sc er t a inp
er for ma nc egoa ls. T he
t heor
et ica l a ppr oa ch l ea ds t o a simu la t i on
-
or i ent ed met hodol ogy b eca use t he u nder l ying goa l is t o expa nd
our under st a ndi ngofi nt el l i genc ea ndt hust heemp ha sisisont heunder lyi ngpr oc ess r
a t her t ha nt heext er i or
per f or ma nc e.
bui l di ng syst ems whos e goa ls ar e t o t est t heor i es. In c ont r a st, r esea r cher s i n
na t ura l la ngua ge pr oc ess i ng op er a t e i n p er for ma nc e
-
or i ent ed mode
-
bu i l di ng syst ems t o per for m t a sks.
S yst emspr oduc edi nt hisla t t er mode(suc ha sdocu ment t ra nsla t or sa ndsyst em
sbywhic hma c hi nesr espond
t heshel lcou l dper f or mit st askjust byma t chi ngit sinput st opr edet er mi neda udi o
pa t t er ns. T he per for ma nc e of such a syst em ma y be sa tisfa ct or y t o a n engi neer ,
but t he wa y it is obt a ine d
wou l d not be
a est het ica l l y pl ea si ng t o a t heor et i cia n.
CS101
VU
P ag e
285
of
3 81
173.
In t he pa st t he
T ur i ng t est
(pr op os ed by Ala n T ur ing i n 1950) ha s ser ved a s a benchma r k i n mea sur i ng
pr ogr ess in t he fi el d of a r t ific ia l i nt ell i genc e. T oda y
t he signif ica nc e of t he T ur ing t est ha s fa ded a lt hou gh
whom weca l lt he int er r oga t or , t ocommu nica t ewit ha test subj ect by mea nsofa t
ypewr it er
syst em wit hout
bei ng t ol d whet her t he t est subject wa s a hu ma n or a ma c hi ne. In t his envir
onment , a ma chi ne wou l d b e
decla r ed t o b eha ve i nt el l i gent l y if t he i nt er r oga t or wa s not a bl e t o dist i ngu is
h it fr om a hu ma n. T ur ing
pr edict ed t ha t by t he yea r 2000 ma
c hines wou l d ha ve a 30 per c ent cha nc e of pa ssi ng a fi ve
-
mi nut e T ur ing
t est
One r ea son t ha t t he T ur ing t est is no longer cons i der ed t o be a mea ni ngfu l mea sur
e of i nt el l i genc e is t ha t
a n eer i e a ppea r a
nc e of i nt ell i genc e ca n be pr oduc ed wit h r ela t i ve ea s e. A wel l
-
known exa mp l e a r ose a s a
r esult oft hepr o
-
you
for a ct ua lpsychot her a py. (T heR oger ia nt hesisist ha t t hepa t i ent , not t hea na lyst ,
shou ldl ea dt hediscuss i on
dur i ng t he t her a peut ic sess i on, a nd t
hus, t hey a r gued, a comput er cou l d poss ib l y c ondu ct a discuss ion a s
wel l a s a t her a pist could. ) Mor eover , DOCT OR pr oj ect ed t he i ma ge of compr ehens
i on so st r ongl y t ha t
-
a nd
-
a nswer
dia l ogu e. In
a sens e, DOCT OR pa ss ed t he T ur ing t est . T he r esult wa s t ha t et hica l, a s well a s t
echnica l, iss u es wer e
r a ised, a nd W ei z enba u m beca me a n a dvoca t e f or ma i nt a ini ng hu ma n di gnit y i
n a wor l d of a dva nci ng
t ec hnol ogy.
VU
P ag e
286
of
3 81
174.
It is i mp or t a nt t o r ea li
z e t ha t t he pr obl em fa c ed b y our ma c hi ne when l ooking a t t he puzz l e is not t ha t
of
mer el y pr odu ci ng a nd st or ing a n i ma ge. T ec hnol ogy ha s been a ble t o do t his for
yea r s a s in t he ca se of
t ra dit i ona l p hot ogr a phy a nd t el evisi on syst ems. Inst ea d, t he pr obl em i
s t o under st a nd t he i ma ge i n or der t o
ext r a ct t hecur
-
r ent st at usoft hepuzzl e(a ndp er ha psla ter t omonit or t he movement oft het il es ). Int
heca se
of our puzzl e
-
s ol vi ng ma c hi ne, t he poss ib l e i nt er pr et a t i ons of t he puzzl e i ma ge a r e r ela t i
vel y l i mit ed. W
e
ca n a ssume t ha t wha t a ppea r s is a lwa ys a n i ma ge conta ini ng t he digit s 1 t hr ou gh
8 in a well
-
or ga niz e d
pa t t er n. T he pr ob l em is mer el y t o ext r a ct t he a r r a ngement of t hes e di git s. F or
t his, we i ma gi ne t ha t t he
pict ur eoft hepuzzl eha sbeenenc odedi nt er ms
T his t e
c hni qu e of r ec ogniz i ng i ma ges is one met hod used i n opt ica l c ha r a ct er r ea der s.
It ha s t he dr a wba ck,
however , ofr equir i nga cer t a indegr eeofunif or mit yf or t hest yl e, siz e, a ndor i ent a t
ionoft hesymb olsbei ng
r ea d. In pa r t icula r , t he bit pa t t er n pr odu c ed
a nd a C or , in t he ca se of t he ei ght
-
puzz l e, a 3 a nd a n 8. We
a r e for t una t e in our puzzl e a pplica t i on beca use we do not need t o under
-
st a nd i ma ges of gener a l t hr ee
-
di mens i ona l sc enes. C ons i der , for exa mp l e, t he a dva nt a ge we ha ve b y b ei ng a
ss ur ed t ha t t he
s ha pes t o b e
r ec ogni z ed (t he di git s 1 t hr ough 8) a r e isola t ed i n diff er ent pa rt s of t he pict ur e r
a t her t ha n a ppea r ing a s
over la ppi ng i ma ges, a s is common i n mor e gener a l s et t ings. In a gener a l p hot ogr
a ph, for inst a nc e, one is
fa ced not only wit h t he pr obl
em of r ec ogniz i ng a n object fr om diff er ent a ngles but a lso wit h t he fa ct t ha t
some p or t i ons of t he obj ect mi ght be hi dden fr om vi ew.
CS101
VU
P ag e
287
of
3 81
i ma ge a na l ys is
is known a s r egion fi ndi ng. T his is t he pr oc ess of iden t if yi ng t hos e a r ea s in a n i ma
ge t ha t ha ve common
pr oper t i es such a s br ight ness , col or , or t ext ur e. S uch a r egi on pr oba bly r epr es
ent s a sect i on of t he i ma ge
t ha t bel ongs t o a singl e obj e
ct . (It is t he a bi l it y t o r ec ogniz e r egi ons t ha t a ll ows c omput er s t o a dd c ol or t o
ol d
-
fa shi onedbla c k
-
a nd
-
whit emot i onpi ct ur es. )S t illa not her a ct i vit ywit hi nt hesc op eofi ma gepr oc ess i ng
is s moot hi ng, whic h is t he pr oc ess of r emovi ng fla ws i n t he i ma ge
. S moot hi ng keeps er r or s in t he i ma g e
fr om confusi ng t he ot her i ma ge
-
pr oc ess i ng st eps, but too muc h smoot hing ca n ca use t he l oss of i mp or t a nt
i nf or ma t ion a s well.
S moot hi ng, edge enha nc ement , a nd r egi on fi ndi ng a r ea ll st eps t owa r d ident if yi
ng t he va r ious
comp onent s
i n a n i ma ge. I ma ge a na l ys is is t he pr oc ess of det er mi ni ng wha t t hes e c omp
onent s r epr es ent a nd ult i ma t el y
wha t t he i ma ge mea ns. H er e one fa c es suc h pr obl em s as r ec ogni zi ng pa r t ia lly
obst r uct ed obj ect s fr om
diff er ent per spect i ves. One a ppr oa ch t o
ima ge a na lys is is t o sta rt wit h a na ss umpt i on a bout wha t t he i ma ge
mi ght b e a nd t hen t r y t o a ss ocia t e t he c omp onent s i n t he i ma ge wit h t he ob j ect
s whos e pr es enc e is
conj ect ur ed. T his a ppea r st o be a na ppr oa ch a ppli ed by hu ma ns. F or inst a nc e, we
somet i mes f
i nd it ha r dt o
r ec ogni z e a n unexp ect ed ob j ect i n a set t i ng i n whic h ou r visi on is blur r ed, but
onc e we ha ve a clu e t o wha t
t he ob j ect mi ght b e, we ca n ea sil y i dent if y it .
T hepr ob l emsa ss ocia t ed wit h gener a li ma gea na lys isa re enor mous, a nd muc hr es
ea r ch i
nt hea r ea r ema i ns
t o b e done. I ndeed, i ma ge a na l ysis is one of t he f i el ds t ha t demonst r a t es how t a
sks t ha t ar e per f or med
qu ic kly a nd a ppar ent l y ea sil y b y t he hu ma n mi nd c ont i nu e t o c ha l l enge t he ca
pa bilit i es of ma c hi nes.
175.
Arti fic i al
Inte ll ige nc e: L ang uag e Process i ng
i ng. In cont r a st, a sta t ement i n a na t ura l la ngua ge ca n ha ve mult ipl e mea ni ngs
dep endi ng on it s cont ext or
even t he ma nner i n whic h it is c ommu ni ca t ed. T hus, t o under st a nd na t ura l la
ngua ge, hu ma ns r el y hea vil y
on a ddit i ona l knowl edge.
a nd
C inder el la ha d a ba ll.
ha ve mu lt ip l e mea ni ngs t ha t ca nnot be dist i nguis hed by par sing or tra nsla t ing ea
ch wor d i ndep endent l y.
Inst ea d, t ou nder st a ndt hes es ent enc esr equir est hea bi l it yt oc omp
r ehendt hec ont ext i nwhic ht hest a t ement
is ma de. I n ot her
i nst a nc es,
CS101
VU
P ag e
288
of
3 81
is fou nd t o b e
John.
ying t he sa me t hing.
A t hir d l evel of a na l ysis is
co nte xt ual analysis.
It is at this l evel t ha t t he cont ext of t he sent enc e is br ought
i nt o t he u nder st a ndi ng pr oc ess . F or exa mp l e, it is ea sy t o i dent if y t he gr a mma
t ica l r ol e of ea c h wor d i n t h e
sent enc e:
Th
e ba t fel l t o t he gr ou nd.
W
eshou l dnot et ha t t heva r i ousl evelsofa na lysis
ist henoun
cat t l e
(modif i edbyt hea dj ect i ve
s t ampedi ng
)ifweenvisi on
t heca t t l es t a mp edi ngont heir own.
But t he subj ect is t he ger u nd
st ampedi ng
(wit h ob j ec t
cat t l e
) in t he c ont ext of a t r oubl ema ker whos e
ent er t a inment cons ist sofst ar t ingst a mp edes. T hust hes ent enc eha smor et ha none
gr a mma t i ca lst r uct ur e
whic h one is co
r r ect dep ends on t he c ont ext.
Anot her ar ea ofr es ea r chin na t ura lla ngua gepr oc ess i ngconc er nsa n ent ir edocu
ment r at her t ha nindi vidua l
sent enc es. Her e t he pr obl ems of conc er n fa l l i nt o t wo c a t egor i es :
i nfor mat io n ret ri eval
a nd
i nfor mat io n
extr act io n.
I nf
or ma t i onr et r i eva lr ef er st ot het a sk of i dent if yi ng docu ment st ha t r ela t et ot het
opi ca t ha nd.
An exa mp l e is t he pr obl em fa c ed by user s of t he Wor l d Wi de W eb a s t hey t r yt o
find t he sit es t ha t r ela t e t o
a par t icula r t opic. T he cur r ent st a t e of t he a r t is
t o sea r ch sit es for key wor ds, but t his oft en pr oduc es a n
CS101
VU
P ag e
289
of
3 81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
176.
CS I mp ac t: CS i mp act o n S ocie ty
Negativ e I mp act:
CS101
VU
P ag e
290
of
3 81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
177.
Onli ne hea lt h
t ips/ iss u es a r e a va ila bl e.
Negativ e i mp act
C omput er wr ist s
Eyes i ght
eye is not mea nt t o l ook 2D f or l ong a mount of t i me. T his i ncr ea ses t he r isk of ey e
dis ea ses.
Hea r i ng l oss is mor e c ommon i n t hos e
l ist ening t o
R a dia t ionDa ma gewhent hedevic eisr unni ng. It sbet t er t oputoffa llsuchdi git a ldevi c
esesp ec ia ll y
mo
VU
P ag e
291
of
3 81
178.
P a per less
680 pounds
of pa per
13, 000 pi ec es of pa p er
(
a r ound 1 b il l i on t r ees i n
t ot a l i n US A) ea ch yea r . Most in t he f or m of pa cka gi ng a nd ju nk ma il.
Negativ e i mp act
E
-
wa st e is sent t o devel op i ng cou nt r i es wher e peop l e ext ra ct ma t er ia ls fr om t hes
e el ect r oni cs such
a s gol d, sil ver , a nd c opp er .
T hey ex
t r a ct t hem b y bu r ni ng t he s ub s t a nces a nd t ha t pr oc es s r el ea s es ha za r dous s
mok e i nt o t he
a ir .
CS101
VU
P ag e
292
of
3 81
179.
CS I mp ac t: E t hi c al Is s ues
Ethi ca l iss ues a r e r ela t ed t o mor a l pr inc ipl es or t he branc h of knowl edge dea l i ng
wit h t hes e. Quest ions of
et hics a nd l ega lit y a r e ess ent ia l i n ma ny i ndust r ies. Doct or s, t ea cher s, gover
nment of fi c ia ls a nd
business p eop l e
Pr iv acy
Most peopl e ha vet heir per sona l da t aspr ea dt hr ou ghout t hedi git a lwor l d. Event hi
ngst hou ght t obesecur e,
such a s ema i l or pr iva t e a ccou nt s, ca n be
a cc ess ed by uni nt ended s our c es. Most emp l oyer s a ct ivel y c hec k
cons i der a t ions. Do p eop l e know how t heir a ccou nt s ar e monit or ed? T o wha t ext
ent is suc h moni
t or i n g
pr iva cy c ompl et el y.
Digi t al O w ne rs hip
a lega l a nd et hi ca l ba ckla sh. How ca n owner ship be est a blis hed i n t he di git a l r ea l
m? T hi ngs ca n be
ea si l y c opi ed a nd pa st ed onl i ne, whic h ma kes i nt el l ect ua l pr oper t y ha r d t o c
ont r ol. L ega l not i ons suc h a s
cop yr i ght ha ve st r uggl ed t o keep up wit h t he di git
a l er a . C ompa ni es i n t he mus ic a nd ent er t a inment
i ndust r ies ha ve pushed f or gr ea t er l ega l pr ot ect i ons f or int el l ect ua l pr oper t i es
whi l e ot her a ct ivist s ha ve
sou ght t o pr ovide gr ea t er fr eedoms f or t he ex c ha nge of i dea s in t he di git a l r ea l
m.
Dat a G at he ri ng
O
n some l evel, ever yone knows t ha t t heir onl i ne l i ves a r e monit or ed. T he Unit ed S
ta t es ha s even pa ss ed
l egisla t i on a ll owing t he gover nment t o a ct ivel y monit or pr iva t e cit i z ens in t he na
me of na t i ona l secur it y.
T hes emea sur esha ver evi veda deba t ea bout wha t
VU
P ag e
293
of
3 81
180.
c op yr i ght s
. T he li c ens e a ls o def i nes t he r esp onsib i l it i es of t he pa r t ies ent er i ng i nt o t he l
ic ens e
a gr eement a nd ma y i mp os e r est r ict i ons on how t he soft wa r e ca n b e us ed.
S oft wa r e l ic e
ns i ng t er ms a n d
condit i ons usua ll y i nc lude
fa ir use
r ight s of ot her s.
pr opr iet a r y
,
fr ee
or
op en s our c e
, t he dist i nguis hing f ea t ur e bei ng t h e
t er ms under whic h us er s ma y r edist r ibut e or copy t he s oft wa r e f or fut ur e
devel op ment
or use.
(C OP P A)
-
gi ves pa r ent s c ont r ol over wha t inf or ma t i on websit es ca n c oll ect fr om t heir ki
ds.
(HIP P A)
-
EC P A ext ends gover nment r est r ict i ons on wir e t a ps t o inc lu de t r a nsmiss i ons of
el ect r onic da t a .
P r event s
wr ongfu l disc l osur e of a n i ndi vidua l 's p er sona ll y i dent if ia bl e i nf or ma t i on st em
mi ng fr om t heir
r ent a l or pur cha se of a udi ovisua l ma t er ia l.
G ramm
-
L e ac h
-
B li l ey Act
CS101
VU
P ag e
294
of
3 81
181.
Int el l ect ua l pr op er t y (IP ) is idea s, inf or ma t ion a nd knowl edge. In t he Uni ver sit y
c ont ext IP ca n be vi ewe d
a s t he r esu lt s a nd out c omes of r es ea r ch
eca us e
it is vi ewed a s a t ra da ble c ommodi t y. Int ell ect ua l pr oper t y r i ght s (IP R ) a r e
spec if ic l ega l r ight s whic h
pr ot ect t he owner s of IP . IP R ca n be subdi vi ded i nt o t he ma jor ca t egor i es b el ow.
Pat e nt
C
opyrig ht
C opyr i ght a ppli es t o lit er a r y a nd dr a ma t ic wor ks, ar t istic a nd mus ica l wor ks, a
udi o a nd vi deo r ec or di ngs,
br oa dca st sa nd ca ble t r a ns missi ons. C opyr i ght is a lso t he usua l wa y of pr ot ect i
ng soft wa r e, a lt hou gh some
soft wa r e ma y b e pa t ent ed if it is a
it does
not need t o be a ppli ed f or
a nd la st s 70 yea r s a ft er t he dea t h of t he a ut hor .
ma xi mu m
dur a t ion is 15 yea r s).
Desig n r ig ht
Des i gnr i ght a ppli est oa spect s oft hesha p e or conf i gur a t ionofa na r t icl e. Unr egist
er ed des i gnr i ght ( whi c h
cover s comput er chips, for exa mp l e) ca n pr ot ect i nt er na l or ext er na l f ea t ur es.
In t he ca se of r eg
ist er ed
des i gns, t he f ea t ur es must a ppea l t o a nd b e ju dged b y t he eye. (R egist er ed des i
gn r i ght s a r e pr ot ect ed for a
ma x i mu m of 25 yea r s. )
T rad e mar k
A
t r a dema r k
C onfi dent ia l i nf or ma t ion is knowl edge whi c h only you poss ess a nd which you ha ve
only r evea l ed u nder a
non
-
disc losur e/ c onf i dent ia l it ya gr eement . T hec ompr ehens i vet a bl eha sbeens hownt
ohi ghl i ght t he det a i ls
of a ll t he a bove i nt ell ect ua l pr op er t i es.
IPR
Covers
Need to
ap p ly?
Maxi mu m
d ur at io n
P a t ent
Invent i ons
Yes
20 yea r s
C opyr i ght
Lit er a r y,
musica l,
a rt ist icwor ks,
a nd soft wa r e
No
70yea r sa ft er
dea t h of
a ut hor
CS101
VU
P ag e
295
of
3 81
R egist er ed
des i gn
I ma ge
l ook
a nd f eel
Yes
25 yea r s
R egist er ed
t ra dema r k
Na me, l ogo
Yes
Unli mit ed
C onfi dent ia l
i nf or ma t ion
Unpubl is hed
secr et
i nf or ma t ion
No
Unl i mit ed
Da t aba se
r ight
Da t aba ses
No
15 yea r s
S uccess fu l ma na gem ent ofIP Rpr ovi dest he mea nsbywhic hi ndi vi dua lsa ndi nst it ut i
onsa r ea blet opr ot ect
t heir cr ea t ive out put
fr om i mit a t or s.
An under st a ndi ng of IP a nd IP R s isa n incr ea si ngl y i mp or t a nt a spect of Univer sit
y a nd busi ness l if e. Now,
mor e t ha n ever , IP isr ec ogni z ed a sa tra da ble c ommodi t y.
CS101
VU
P ag e
296
of
3 81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
182.
CS I mp ac t: S ec ur ity
Co mp ut ersec ur ity
, a lsoknowna s
cyber
-
sec uri ty
or
IT sec ur ity
, ist hepr ot ect i onofinf or ma t i onsyst ems
fr om t heft or da ma ge t o t he ha r dwa r e, t he soft wa r e, a nd t o t he i nf or ma t i on on
t hem, a s well a s fr om
disr upt ion or misdir ect i on of t he ser vic es t hey pr ovi de. It inc ludes cont r oll i ng phy
si ca l a ccess t o t he
ha r dwa r e, a s wel l a s pr ot ect i ng a ga i nst ha r m t ha t ma y come via net wor k a cc
ess , da t a a nd c ode i nj ect i on,
a nd du e t o ma lpr a ct ic e by op er a t or s, whet her int ent i ona l, a ccident a l, or due t o
t hem b ei ng t r ic ked int o
devia t i ng fr om s ecur e pr oc ed
ur es.
What ar e t he co ncer ns of co mp ut er sec ur ity?
1. C onf i dent ia l it y:
-
2. Int egr it y:
-
3. Ava i la bil it y:
-
a r e you r ea l l y com mu nica t i ng wit h whom you t hi nk you a r e commu nica t i ng wit h
Ma lic i ousi nt
ent sca na lsob ea fa ct or incomput er secur i t y. Int r uder soft enus eyour comput er sfor a
tt a cki ng
What is fir ew al l?
A f ir ewa l
l is a secur it y
-
c onsc ious pi ec e of ha r dwa r e or soft
-
wa r e t ha t sit s bet ween t he I nt er net a nd your
net wor kwit ha singl e
-
mi ndedt a sk:pr event i ngt hemfr omget t i ngt ous. T hefir ewa l la ct sa sasecur it ygua r d
bet ween t he Int er net a nd your loca l a r ea net wor k (
LAN ). Al l net wor k t r a ffic int o a nd out of t he L AN must
pa ss t hr ough t he f ir ewa ll, whic h pr event s una ut hor iz ed a ccess t o t he net wor k.
CS101
VU
P ag e
297
of
3 81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
183.
CS I mp ac t: Priv acy
Indi vi dua l 'sr ight t o ownt he da t a gener a t edby hisor her lif ea nda ct i vit i es, a ndt o
r est r ict t he out wa r dfl o w
of t ha t da ta . Pr iva c y uses t he t heor y of na t ura l r ight s, a nd gener a ll y r esponds t o
new i nf or ma t ion a nd
com mu nica t i on t ec hnol ogi es. In Nor t h Amer i ca ,
Sa muel D. Warr en
a nd
wr ot e t ha t
pr iva cy is t he "r i ght t o be l et a lone".
S ocia l S it es
(F a ceb ook, t wit t er )
T el ep hone c ompa ni es ( mob il e net wor ks )
S ma r t cit y ca mer a s on r oa d
E ma ils
P er sona l S oft wa r e
H ow to hand le o n i nte r ne t
Anonymiz i ng
pr oxies
Anonymiz i ng
net wor ks
Googl e:
ht t ps
:/ /
pol ic i es. googl e. c om/ pr i va c y
ms n:
ht t ps:/ /
www. msn. c om/ en
-
us/ a ut os/ pa rt ner / pr iva c yp ol i c y
Wha t sApp :
E PIC
Wa sgi ngon D. C .
hu ma n r ight s
iss u es.
EP IC ha s pur sued sever a l succ ess fu l consu mer pr iva cy c omp la i nt s wit h t he
US F eder a l T ra de
C ommiss i on, conc er ni ng
S na pcha t
Googl e
(r ol l
-
out of
Googl eBu zz),
Micr os oft
(Ha i lst or m l og
-
i n), iss u es.
PI
P r iva cy I nt er na t i ona l
CS101
VU
P ag e
298
of
3 81
CS101
VU
P ag e
299
of
3 81
Mod ule
184
82. 82.
184.
CS I mp ac t: S oci al Is s ues o f IT
1.
2.
T he onl y mea ns of get t i ng i n t ouc h wit h ma j or cor por a ti ons or fa mous peop l e i n
t he publ ic eye pr ior t o t he
a dvent of di git a l c om mu ni ca t ion wa s via a st iffl y wr it t en l et t er . T his wa s, of c
our se, a cc ess ib l e onl y t o t he
i nt ended r ec ip i
ent a nd t hus a ver y pr iva t e wa y f or t he disgr unt l ed t o vent t heir spleen. But fir st
mess a g e
boa r ds a nd now socia l media s er vic es li ke F a c eb ook a nd T wit t er ar e bei ng us ed t
o defa me p eop l e a n d
business es i n a n int r i ns ica l l y publi c ma nner .
85. 85.
3.
Ide nt ity T he ft
F ra u
d is a not her spur ious a ct ivit y t ha t ha s been a bl e t o evol ve i n t he wa ke of ea si l y a
ccess ibl e c omput er s
a ndt hei nt er net . P er ha psmost pr obl ema t i ca ndpr eva l ent oft heva r i ousfra udul ent
a ct ivit i esisi dent it yt heft ,
i n whic h p er sona l det a i ls of i nnoc ent p e
opl e a r e ha r vest ed b y a t hir d pa r t y so t ha t t hey ca n b e us ed f or
ma li c ious pur pos es. T his inc ludes ca rr yi ng out il li c it onli ne t r a nsa ct ions a nd ot
her da ma gi ng a ct ivit i es t ha t
ca n ha ve s er i ous r a mi fi ca t ions.
86. 86.
4.
Cyber B ul ly i ng
5.
6.
Pr iv acy
CS101
VU
P ag e
300
of
3 81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
r isks a r e st il l wi despr
ea d. T his ext ends b eyond s i mp l y gi vi ng a wa y pr iva t e da t a via cha t r ooms, mess
a ge
boa r ds a nd e
-
c omm er c e s it es a nd ext ends i nt o t he c omp r omisi ng wor l d of soc ia l media .
89. 89.
7.
8.
E d uc at io n
9.
T error is m & Cr i me
10.
CS101
VU
P ag e
301
of
3 81
185.
C ont ent fi lt er i ng, in t he most gener a l sens e, i nvol ves u sing a pr ogr a m t o pr event
a cc ess t o
cer t a in it ems,
whic h ma y b e ha r mfu l if op ened or a cc ess ed. T he mos t common it ems t o f i lt er a r
e ex ecut a bl e, ema i ls or
webs it es.
H ow it works
S pam e mails
As ema i l
spa m
C AN
-
S P AM Act i n US
-
S pa m L egisla t i on (C AS L)
Ant i
-
spa m la w i n Eur op e
S pa m
CAN
-
S PAM Ac t
94. 94.
1.
95. 95.
2.
96. 96.
3.
Ident if y t he mess a ge a s a na d
97. 97.
4.
98. 98.
5.
Honor opt
-
out r equ est s pr omptl y
99. 99.
6.
B e honest
CS101
VU
P ag e
302
of
3 81
186.
CS I mp ac t: C hil dre n
Prote ct io n and E le ctro ni c T he ft
T her ear elot sofr ea sonswhyp eopl est a r tusingpar ent a lcont r ols. P er ha pst ost opla t
eni ght phonec hec ki ng.
to
r educ e t he
t ot a l a mou nt of t i me b ei ng sp ent on scr eens i n gener a l. T her e a r e ma ny mor e ca
ses. Ult i ma t el y
i n t heir use of di git a l t ec hnol ogy.
W e hop e a nd a i m
t o enc our a ge a n a t t it ude a nd a ppr oa ch i n our kids t ha t wi ll r ender pa r ent a l c
ont r ol s
C ont a ct R isks
Onli ne
Ma r ket i ng
Over sp endi ng
Elect r onic T heft
Inf or ma t i on P r iva cy
Inf or ma t i on S ecur it y
Conte nt Ris ks
Ha r mful Advi c e
Cont act R is ks
Onli ne Ha r a ss ment
C yb er bull yi ng
Il l ega l i nt er a ct i ons
O nl i ne M ar ket i ng
Il l ega l a nd Age
-
r est r ict ed pr oduct s
E lect ro nic T he ft
Onli ne F r a ud
Onli ne sca m
Ident if y t heft
CS101
VU
P ag e
303
of
3 81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
How to
protect
W eb F ilt er i ng
Gui de ki ds
CS101
VU
P ag e
304
of
3 81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
187.
Offic e.
F igur e 130 is t he scr een shor t for wi ndows XP t o open MS Wor d 2007.
Fi gure
130
: St art Menu t o l aunch MSW ord
T he O ffice
B utto n
CS101
VU
P ag e
305
of
3 81
Ea ch t a b opens a dif f er en
t r ibbon wit h gr oups of comma nds i ns i de it . Micr osoft ha s tr ied t o ma ke t h e
pla c ement of t he c omma nds wit hi nb ot h gr oups a nd t a bsa s int uit i ve a s poss ibl e t
o ma ke t hem ea s y t ofi nd.
By usi ng t he R ibb on
syst em,
In t he l ower
r ight
-
ha nd
S i mp l e But t ons
Dr op
-
do wn menu s
But t ons
S i mp le B utto ns
wor k a s
T oggles
or
on/ off switc hes
. When t he c omma nd is off it wil l b e sur r ounded b y
blu e a nd l ook l i ke a l l ot her c omma nds a s shown i n t he F igur e 133. When a comma
nd but t on is on, it wi l l
be sur r ounded by or a nge. A com ma nd wi l l onl y wor k when it is on.
B old
is a n exa mpl e of a but t on a s
shown i n F igur e 133.
CS101
VU
P ag e
306
of
3 81
Fi gure
133
: Font Panel
com ma nd
134.
Fi gure
134
: Bol dC l i cked i n Fon t Pan el
Drop
-
dow nme nub ut to ns
wi l lha vea downa rr owt ot her i ght oft hec omma nd. Jus t likebut t ons, t hedr op
-
down menu c omma nd wi l l be sur r ounded by or a nge a nd t he dr op
-
down list wi l l op en up.
Change c ase
cont r ol is a n exa mp l e of a
dr op
-
down menu a s shown i n t he F i gur e 135.
Fi gure
135
: Fon t Pan el C ha ng i ng C as e
CS101
VU
P ag e
307
of
3 81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
Fi gure
136
: Underl i ne
Panel
b utto ns
La uncher ( or Dia logExpa nder s)but t onsa sshowni nfi gur e8ar eusua ll ydispla yedi nt
hebot t o m
r ight cor ner ofs ome gr oups. C lic ki ngt he
la unc her bu t t onwil lop enup as er i es ofopt i ons eit her
i n a Ta sk pa ne (suc h a st he C lipb oa r d) or a Dia log window such a s t he F ont gr oup.
Fi gure
137
: Panel L aunch Butt ons
Mi ni T ool B ar
T he
Mi ni T oolba r a ppea r s a ut oma t ica l l y whenever you sel ect t ext a nd c ont a ins c
ommon t ext
for ma t t i ngc omma ndsa sshowni nt heF i gur e138. T oUset heMi niT oolba r :S el ect t het
extyou
wa nt t ofor ma t a ndcl ic kt hedes ir edcomma ndont heM i niT oolba r .C lic ka nywhe
r eout si det h e
M ini T oolba r t o clos e
it .
Fi gure
138
: Mi niT oolbar
CS101
VU
P ag e
308
of
3 81
188.
E xerc ise
104. 104.
1.
T ype wor d
105. 105.
2.
disa pp ea r s.
106. 106.
3.
r ea ppea r s.
107. 107.
4.
exa mp l e. "
108. 108.
5.
P r ess C tr l+bt o bol d. Wor d bolds t he
t ext .
109. 109.
6.
t ext .
110. 110.
7.
t ext .
111. 111.
8.
p er for med
list ed. T o undo t he u nder l i ne, cl ic k Under l i ne; t o undo t he under li ne a nd it a l ic,
cl ic k
Under l i ne It a li c; t o undo t he
under li ne, it a l ic, a nd b ol d cl ic k B old
et c.
112. 112.
9.
1.
114. 114.
2.
P r ess C tr l+z. T he t yp i ng
disa ppea r s.
115. 115.
3.
r ea pp ea r s.
116. 116.
4.
exa mp l e. "
117. 117.
5.
P r ess C tr l+ut o
under l i ne.
118. 118.
6.
r emoved.
119. 119.
7.
r ea pp ea r s.
CS101
VU
P ag e
309
of
3 81
189.
T hehomer ibb onisoneoft hemost i mpor t a nt r ibbona va ila bl ei nt heMS Wor d. F igur
e140showst hehom e
r ibbon. It cont a i ns dif f er ent i mp or t a nt gr oups suc h a s: C lipb oa r d, F ont , P ara
gr a ph, St yl es a nd E dit i ng. W e
wi ll b e l ea r ni ng ea c h modu l e of home r ibb on i
n t he nex t modul es i n det a i ls.
Fi gure
140
: Home ri bbon
CS101
VU
P ag e
310
of
3 81
190.
T he
H o me
r ibbon is ma de up of t he most used c omma nds i n Wor d. T he fir st gr oup on t he
H o me
r ibbon is
t he
Cl ip bo ar d. Copy
,
Cut
,
Past e
a nd
Fo r mat Past e
a r e t he c omma nds wit hi n t he C lipb oa r d gr oup a s
shown i n t he F igur e 141. T he C lipb oa r d comma nds a r e on t he H ome r ibbo
n of
Word
a nd a ll ot her Offic e
2007 a pplica t i ons t ha t use t he r ibbon. T he dia l og expa nder a rr ow of t he C l ipboa r
d gr oup wil l op en up t h e
Cl ip board p ane
, s howi ng a ll it ems t ha t ca n be pa s t ed.
Fi gure
141
: C l i pboard Group
C ut and
Past e
Youca nuseW or d'sC utfea t ur et or emovet extfr oma docu ment. Youca nuset heP a st efea
t ur et opla c et h e
i nf or ma t ion youcut a nywher e i nt hesa me or a not her docu ment . In ot her wor ds,
youca n move i nf or ma t io n
fr omonep la c ei na
docu ment t oa not her pla c ei nt hesa meor diff er ent docu ment b yus i ngt heC ut a ndP a
st e
f ea t ur es. T he Of fi c e C l ipboa r d is a st or a ge a r ea . When you cut , Wor d st or es t
he da t a you cut on t h e
C lipb oa r d. You ca n pa st e t he i nfor ma t i on t ha t is st or ed on t he C l ipbo
a r d a s oft en a s you l i ke.
1.
2.
124. 124.
3.
C hoos e t he Home t a b.
125. 125.
4.
C lic k t he C ut but t on
in t he C lipb oa r d gr oup a s shown i n t he F i gur e 142. Wor d cut s t he
t ext you s el ect ed a nd pla c es it on t he C l ipboa r d. Your text shou l d now r ea d:
CS101
VU
P ag e
311
of
3
81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
Fi gure
142
: C ut opt i on i n cl i p
board group
1.
2.
3.
C hoos e t he Home t a b.
129. 129.
4.
C lic k t he P a st e but t on
i n t he C l ipboa r d gr oup a s shown i n t he F i gur e 143. Wor d pa st es t he
t ext on t he C l ipb oa r d. Your t ext shoul d now r ea d:
Fi gure
143
: Past i ng i n Document
1.
T ype t he
f ol l owi ng:
I want to move. I am co nt e nt
w here I am.
131. 131.
2.
CS101
VU
P ag e
312
of
3 81
3.
R ight
-
c l ic k. T he M i ni t oo lba r a nd a cont ext menu a pp ea r.
133. 133.
4.
C lic k C ut on t he menu a s shown i n t he F i gur e 144. You r t ext shoul d now r ea d: "I a
m c ont ent
wher e I a m. "
Fi gure
144
: Past i ng
i n Document (Alt ernat e Met hod)
1.
2.
3.
R ight
-
c l ic k. A M i ni t oo lba r a nd a cont ext menu a pp ea r a s s hown i n t he F igur e 14 5.
137. 137.
4.
C lic k P a st e. Your t ext shoul d now r ea d:
Fi gure
145
: Past i ng i n Document (Alt ernat e Met hod)
CS101
VU
P ag e
313
of
3 81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
1.
2.
3.
P r ess C tr l+x.
1.
P la ce t he cur sor a ft er t he
p er i od i n t he s ent enc e: "I a m cont ent wher e I a m. "
142. 142.
2.
3.
P r ess C tr l+v.
144. 144.
4.
Your
t ext s hou l d no w
r ea d:
VU
P ag e
314
of
3 81
191.
Fi gure
1
46
: Font group
146. 146.
7.1.1
Fi gure
147
: T ypi ng y
our name
148.
Fi gure
148
: C hanging f ont
CS101
VU
P ag e
315
of
3 81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
Fi gure
149
: Appl yi ngbol d and under l i ne
a s shown i n t h e
F igur e 150.
Fi gure
150
: C hangi ng Font Size
CS101
VU
P ag e
316
of
3 81
192.
Fi gure
151
: Paragr aph Group
Fi gure
152
: N umbers varri at i onsi n paragr aph group
VU
P ag e
317
of
3 81
Fi gure
153
: Bull et s vari at ionsi n paragr aph group
Intr oduct i on t o Com put in g
CS101
VU
P ag e
318
of
3 81
193.
Word Process i ng: MS Word (Par agr ap h G ro up
-
II)
1.
App le
O rang e
G rap e
Mango
C her ry
151. 151.
2.
3.
C hoos e t he Home t a b.
153. 153.
4.
In t he P a ra gr a ph gr oup, clic k t he down a rr ow next t o the Bu l l et s butt on
. T he Bull et Libr a r y
a ppea r s.
154. 154.
5.
list .
Not e: As you move your cur sor over t he va r ious bul l et st yl es, Wor d displa ys t he bu
ll et st yl e onscr een.
Fi gure
154
: Bull et sel ect i on
T o re move t he b ul l et i ng:
155. 155.
1.
S el
ect t he list a ga i n.
156. 156.
2.
C hoos e t he Home t a b.
157. 157.
3.
4.
CS101
VU
P ag e
319
of
3 81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
N umb ers T as k
159. 159.
1.
App le O range
2.
3.
C hoos e t he Home t a b.
162. 162.
4.
Fi gure
155
: Adding
N umberedL i sts
T o re move t he nu mb er i ng :
163. 163.
1.
S el ect t he list a ga i n.
164. 164.
2.
C hoos e t he Home t a b.
165. 165.
3.
4.
CS101
VU
P ag e
320
of
3 81
194.
Fi gure
156
: St yl e Group
A
sty le
is a set of
for mat t i ng
c har act er ist ics
, such a s font na me, si z e, col or , para gr a ph a lignment a nd
spa cing. S omest yl es eveni nclu deb or der sa nds ha di ng. F or exa mpl e, i nst ea d oft a ki
ngt hr ees epa r a t est eps
t ofor ma t your hea di nga s16
-
poi nt , bold, C a mbr ia , you ca na chi evet hesa me
r esu lt i nonest epbya ppl yi ng
t he built
-
i n H ea ding 1 st yl e. You do not need t o r eme mb er t he c ha r a ct er ist ics of t he H ea
di ng 1 st yl e. F or
a nd t hen c l i
c k H ea di ng 1 in t he ga l l er y of st yl es.
CS101
VU
P ag e
321
of
3 81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
195.
Fi gure
157
: Edit i ng
group
Under t he
Find
c omma nd, t her e is t he
GoTo
comma nd. T he G o T o comma nd ca n b e used t o
i mmedia t el y go t o a pa ge, a sect i on or a ny ma r ked l oca t ion wit hi n your docu
ment .
T he
S el ect
c omma nd
CS101
VU
P ag e
322
of
3 81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
196.
docu ment . T he
i nit ia l pa r t of t he i ns er t ta b in wor d r ibbon ha s been shown i n t he F i gur e 158.
Fi gure
158
: Inert t ab
P a ges Gr oup
Ta bles Gr oup
Media
Links
C omment s
T ext
S ymb ols
Intr oduct i on t o Com put in g
CS101
VU
P ag e
323
of
3 81
P a ges
gr oup is in t he fa r left of t he i ns er t ta b. You ca n ins er t fr om t he t hr ee ca t egor i es
for pa ges whic h a r e;
C over P a ge, Bla nk P a ge, a nd P a ge Br ea k a s shown in t he F i gur e 159. T hes e f ea t
ur es a r e usefu l if you a r e
cr ea t i ng a pr of ess i ona l or l ong docu ment .
Fi gure
159
: Pages group i
n t hei nsert t ab
Cover Page
Cover pag e
E xer cis e: Cre at i ng a Cover Page
171. 171.
1.
C lic k t he
I ns ert
2.
T oopent he
B ui lt
-
i nCover PageG all ery
, cl ic kt he
do w nar row
t ot her ight of
CoverPage
i nt h e
Pages
gr oup on t he
I nser t
t a ba s shown i n t he F i gur e 1 60.
Fi gure
160
: Insert i ngC over Page
173. 173.
3.
S cr oll down a nd
c l ic k
t he des ir ed c over for t he docu m ent fr om t he
Cover Page G al le ry
. Us e t he
sc
r ol l ba r or scr ol l a rr ow t o s ee a ll t he cover pa ge c hoi c es.
174. 174.
4.
1.
C lic k t he
I ns ert
t a b t o ma ke it t he a ct ive
t a b.
176. 176.
2.
T oop ent he
B ui lt
-
i nCoverPageG all ery
, cl ic kt he
do w nar row
t ot her i ght of
CoverPage
i n t he P a ges gr oup on t he
I nse rt
t a b.
CS101
VU
P ag e
324
of
3 81
3.
S cr oll down a nd s el ect
Re move C urre nt Cover Page
a sshown i n t he F igur e
1
178. 178.
61.
Fi gure
161
: Removi ng cover page
B lank Page
Gener a l l y,
Wor d i ns er t sa bla nkpa gea ut oma t ica l l y whi l e youa r et ypi ng. B la nkP a gei nI ns er
t t a bca nhel p
you a dd a new pa ge a nywher e i n a docu ment when r equir ed.
1.
2.
C lic k on Bla nk P a ge i n I ns er t T a b (F igur e 158).
Page B re ak
1.
cl ic k wher e you wa nt t o i ns er t P a ge Br ea k
182. 182.
2.
CS101
VU
P ag e
325
of
3 81
198.
Word
Process i ng: MS Word (T ab le G ro up)
1.
Fi gur e
162
: T ables group
185. 185.
2.
3.
4.
5.
Obser ve t he new t a b op ened "T a ble T ools". You ca n use t his t ool t o a pply fur t her f
or ma t t i ng t o
your cr ea t ed t a ble
Fi gure
163
: Sel ect i ng R
ows and Col umns
Intr oduct i on t o Com put in g
CS101
VU
P ag e
326
of
3 81
199.
Fi gure
164
: Il l ust rat i ons
Pict ure
T hef ir st sel ect i on i nI llust r a t ionsisI ns er t a pict ur efr oma fi l e. W hen youc li c kont
hisa
wi ndow wi l lop e n
for you t o br ows e t o a phot ogr a ph or ot her pict ur e you ha ve sa ved on your comput
er .
C l i p A rt
T o il lust r at e a speci fi c
conc ept ,
S hapes
Wor d 2007 pr ovides a wide r a nge of sha pes (F i gur e 16 5) t o sel ect a nd i ns er t in
your docu ment a s per your
r equir ement . It a lso pr ovi des C a nva s t o pla c e a ll t he S ha pes a t one p la c e wit
hout bei ng dist ur bed when
fur t her c ha nges a r e ma de a s shown i n t he fi gur e
190. 190.
1.
165.
193. 193.
2.
166.
195. 195.
3.
Ar r a nge
i ns er t ed sha pe t o for m S now Ma n a s done i n F i gur e
196. 196.
167.
VU
P ag e
327
of
3 81
Fi gure
165
: Shapes t ypesi nW ord
Fi gure
166
: Shapes required t o make snowman
Fi gure
167
: Snowman
CS101
VU
P ag e
328
of
3 81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
S mart Art
t he F i gur e 168.
Fi gure
168
: Smart
Art
Exer c is e: H ow t o a dd C yc l e S ma r t Ar t
197. 197.
1.
2.
169.
201. 201.
4.
C lic k O n [T EXT ] t o a dd t ext. "Ba by", "C hil d", "T een" a nd " Adu lt ". Not ic e t he extr
a C ir cle
l eft (F i gur e 170).
Fi gure
169
: Basi c cycl e
CS101
VU
P ag e
329
of
3 81
Fi gure
170
: Human Li f eC ycl e
Fi gure
171
: Adding and Removi ng Object s
Intr oduct i on t o Com put in g
CS101
VU
P ag e
330
of
3 81
200.
Fi gure
172
: L i nks group
H yperl i nk
Hyp er l i nkisusedt oa ddl ink ofot her docu ment sor web pa gesi nyour Docu ment . H er
eishow youca na dd
Hyp er l i nk. C lic k on hyp er l ink in i ns er t r ibbon t a b, a wi ndow wi l l op en a s in
t he F i gur e 173.
203. 203.
1.
2.
3.
S el ect B ookma r k
206. 206.
4.
S el ect r esp ect i ve opti on t o l oca t e fi l e or web l inks t ha t you wa nt t o a dd i n docu
ment
207. 207.
5.
6.
You ca n l i nk t o va
r ious f il es i. e. exist i ng fi l e i n your sys t em, l i nk t o pla c e wit hi n docu ment
(i dea l t o li nk t a bl e of c ont ent s wit h hea di ngs).
Fi gure
173
: Adding Hyperl i nk
B ookmar ks
1.
2.
3.
Ent er
bookma r k
CS101
VU
P ag e
331
of
3 81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
212. 212.
4.
Fi gure
174
: Adding Bookmark
CS101
VU
P ag e
332
of
3 81
201.
Word Process i ng: MS Word (Co mme nts and H ead er & foote r)
Exer c is e: H ow t o Us e H ea der
& F oot er s
214. 214.
1.
2.
3.
217. 217.
4.
Fi gure
176
: Header i n edit mode
Fi gure
177
: Aft er Header Inserti on
CS101
VU
P ag e
333
of
3 81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
202.
Word
Process i ng: MS Word (T ext G ro up ( Part
-
1) )
178.
Fi gure
178
: T ext group
1.
C lic k t he T ext Box but t on, loca t ed i n t he T ext gr oup on t he I ns er t t a b. Fr om t he
menu t ha t
a ppea r s, choos e Dr a w T ext Box.
221. 221.
2.
C lic k wher e you wa nt one c or ner of t he t ext box t o a ppea r a nd dr a g t o wher e you
wa nt t he
opp osit e c or ner .
222. 222.
3.
R el ea se t he mous e b
ut t on a nd t hen t yp e your t ext .
Fi gure
179
: Adding T ext Box
Q uic k p arts
ca ll it up quic kl y whe n
you need it . T his is esp ecia l l y ha ndy for
i ns er t ing i nfor ma t i on such a s a C ompa ny
Na me, Logo, C ompa ny Addr ess or a ny
ot her infor ma t i on t ha t you us e oft en.
Exer c is e: H ow t o C r ea t e a Quick P a r t
223. 223.
1.
2.
3.
4.
5.
T oins er t a Qu
ickP ar tt ha t youha vesa ved, cl ic kt heQu i ckP a r tsbut t ona ndchoos et heQuic k
P ar t you wa nt t o use.
Word Art
CS101
VU
P ag e
334
of
3 81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
Exer c is e: H ow t o a dd Wor d Ar t
228. 228.
1.
On t he I ns er t t a ba nd t hen C l ic k W or dAr t .
229. 229.
2.
3.
In t he E dit Wor dAr t T ext dia l og box, t yp e your t ext a nd s el ect font a nd siz e.
231. 231.
4.
5.
In t he E dit Wor dAr t T ext dia l og box, cl ic k OK. T o
ins e r t int o t he docu ment .
Fi gure
180
: W ord Art Gall ery
CS101
VU
P ag e
335
of
3 81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
203.
Drop Cap
Exer c is e: H ow t o Us e Dr op C a p
234. 234.
1.
T ype t he pa r a gra ph a s you nor ma l l y wou l d.
235. 235.
2.
3.
C hoos e t he dr op ca
p st yl e you wa nt t o us e.
237. 237.
4.
Adjust t he dr op ca p, if you wa nt t o.
S y mbo ls
Anot her fea t ur e fou nd is Micr os oft Wor d is S ymb ols. You ca n a dd pr e
-
ma de ma t hema t i ca l Equa t i ons a nd
va r ious S ymb ols wher e r equ ir ed i n your docu ment . However , if you ca nnot fi nd
wha t you
wa nt , you ca n
a lso cr ea t e your own equa t i ons.
2.
C lic k t he but t on ( not it s menu t r ia ngl e), a nd t wo t hings ha ppen. F ir st, a n equa t
ion c ont r ol
isi ns er t e
d i nt o your docu ment a t t hei ns er t i onpoi nt er 'sl oca t i on. S ec ond, t heEqua t i onT
ools
Des i gn t a ba ppea r s on t he R ibb on.
Fi gure
181
: Drop cap ' P'
CS101
VU
P ag e
336
of
3 81
204.
Des i gn r ibbon (a s shown i n t he F i gur e 182) cont a ins t he f oll owi ng gr oups:
Fi gure
182
: Desi gn Ribbon
T he mes
Dr op
-
D own. T hedr op
-
do
wnc ont a i nst hec om ma nds:Bui lt
-
i n, Mor eT hemesonMicr osoft Offi c e
Onli ne, Br ows ef or T hemesa ndS a veC ur r ent T heme. Thebu ilt
-
i nt hemesa r e:Of fi c e, Ap ex, Asp ect , C i vi c,
C onc our se, Equ it y, F l ow, F oundr y, M edia n, M et r o, Modul e, Opul ent , Or i el, Or
igi n, P ap
er , S olst ic e,
T ec hnic, T r ek, Ur ba na ndVer ve. T oolt ipi ndica t est hec urr ent t heme. T hedefa ult t
hemeis"Off ic e". T oolt ip
i ndi ca t est hecur r ent t heme. Quic kAc c ess t omor et hem essa veddownonMicr os oft
Offi c eOnl ine. D efa ult
t heme is "Off ic e". C ha nges t he
S tyle S et
Colors
Dr op
-
Down. Displa ys a list ofa ll t he a va ila bl e col or sa nd l et s you c ha nge t he col or comp
onent of
t he a ct ive t heme.
Fo nts
Dr op
-
D own. Displa ysa list ofa llt he
Dr op
-
D own. Quic kl y c ha nge t he li ne a nd pa ra gr a ph spa cing i n your docu ment . T he
dr op
-
downc ont a i nst hec om ma nds:N oP a ra gr a phS pa ce, C ompa ct , T ight , Open, R ela x
ed, D oubl e, C ust o m
P ara gr a ph S pa cing.
E ffe cts
Dr op
-
Down. Displa ys a list of a ll t he a va ila bl e ef f ect s a nd l et s you cha nge t he eff ect
comp onent
of t he a ct ive t hem e. T he dr op
-
down c ont a ins t he comma nds : Offi c e, Ap ex, Aspect , C ivic, C oncour s e,
Equ it y, F l ow,
S et As Default
-
Fi gure
183
: Page background group
Page Color
Dr op
-
em e
col or pa let t e.
CS101
VU
P ag e
337
of
3 81
Page B orde rs
Wate r mar ks
1.
2.
3.
CS101
VU
P ag e
338
of
3 81
205.
Fi gure
184
: Page set up group
Displa yi ng T ext i n t wo
C olu mns
Asyou mi ght ha ve obs er vedi nnewspa per st ext isdispl a yedint woor t hr eec olu mns. M
icr osoft
Wor d pr ovi des t his f ea t ur e in P a ge La yout R ibbon t a b. By defa ult t he t ext is disp
la yed i n on e
1.
185)
Fi gure
186
: T ext i n t wo col umns
CS101
VU
P ag e
339
of
3 81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
206.
Fi gu r e
187
: Paragr aph gro
up i n page layout
Inde nt L eft
-
T extBox. T his a utoma t ica ll y upda t es t o indica t e how muc h i ndent a t ion ha s been a
ppli ed t o
t he pa ra gr a ph of t he cur r ent sel ect i on. T his ca n be used t o c ha nge t h
e l eft i ndent a t i on for t he cur r ent
sel ect i on.
Inde nt Rig ht
T ext Box. T his a ut oma t ica l l y upda t es t o i ndi ca t e how muc h i ndent a t ion ha s
been a ppli ed t o
t he pa r a gra ph of t he cur r ent s el ect i on. T his ca n b e used t o c ha nge t he r i ght i
ndent a t i on f or t he cur r ent
sel ect i on.
S pac i ngB e fo re
T ext B ox. T hisa ut oma t ica l l yup da t es t oi ndica t ehow muc hspa ci ng is def i nedb efor
et he
pa ra gra ph of t he cur r ent sel ect i on. T his ca n be used t o cha nge t he spa ci ng for t he
cur r ent sel ect i on.
S pac i ng A fter
CS101
VU
P ag e
340
of
3 81
207.
T his gr oup
a lso a ppea r s on t he Dr a wi ng T ools
-
Fi gure
188
: Arrange Group
Posi tio n
Dr op
-
D own. Displa ys a list of pi ct ur e p osit i oning opt i ons. T he dr op
-
down c ont a i ns t he
com ma nds: I n Line
wit h
T ext a nd T ext Wra pping. You ca n sel ect Mor e La yout Opt i ons t o disp la y t h e
" Adva nc ed La yout" dia l og b ox.
Wrap T ext
Dr op
-
Down. T he dr op
-
down c on
t a i ns t he c om ma nds: I n L i ne wit h T ext , S quar e, T ight ,
T hr ough, T opa nd B ot t om, B ehi nd T ext , In F r ont of T ext , Edit Wra pP oi nt s a nd
Mor e La yout Opt i ons.
B ri ng Forw ard
But t on wit h Dr op
-
D own. T he but t on br i ngs t he s el ect ed obj ect f or wa r d one l evel. T h e
dr op
-
down pr ovi des a comma nd t o br i ng t he s el ect ed ob j ect i n fr ont of a l l t he ot her
ob j ect s.
S end B ac kw ar d
-
(S end t o Ba c k i n 2007). Butt on wit h Dr op
-
Down. T he butt on br ings t he s el ect ed object
ba ck one l evel. T he dr op
-
down pr ovi des a comma nd t o send t he s el ec
t ed ob j ect t o t he ba ck of a ll t he ot her
ob j ect s.
S elect io n Pane
Al ig n
Dr op
-
D own. T hedr op
-
downc ont a i nst he com ma nds: Al i gnL eft , Ali gnC ent er , Al i gnR ight , Al i gn
T op, Al ign M iddl e, Al i gn B ot t om,
Dist r ibut e Hor i z ont a ll y, Dist r ibut e Ver t ica l l y, Al i gn t o P a ge, Ali gn t o
Mar gi n, Al i gnS el ect edObject s, Vi ewGr i dli nesa ndGr i dS et t i ngs. T heGr i dS et t i
ngsdisp la yst he"Dr a wi ng
Gr id" dia l og box.
G roup
-
Dr op
-
Down. T he dr op
-
down c ont a i ns t he c omma nds: Gr ou
p, R egr oup a nd Ungr oup.
Rotat e
Dr op
-
D own. T he dr op
-
down c ont a i ns t he c omma nds : R ot a t e R i ght 90, R ot a t e Left 90, F lip
Ver t ica l, F lip Hor iz ont a l a nd M or e R ot a t ion Opt i ons.
CS101
VU
P ag e
341
of
3 81
208.
T ab le o f Co nt e nts
-
Dr op
-
D own. P r ovide a n over vi e w of your docu ment by a ddi ng a ta ble of c ont ent s.
T he dr op
-
down c ont a i ns t he c omma nds : Bu ilt
-
i n, Ins er t T a ble of C ont ent s a nd S a ve
S el ect i on t o T a ble of
C ont ent s Ga ll er y a s shown i n t he F i gur e189.
Fi gure
189
: T abl e of C ont ent
AddT ext
Dr op
-
Down. T hedr op
-
downcont a i nst he
Foot no tes
-
Fi gure
190
: Foot not es Group
Inse rt
Foot no te
( Alt + C t r l + F ). Ins er t s a foot not e a t t he cur r ent pos it i on. F oot not es a r e a ut
oma t ica l l y
r enu mb er ed a s you move t ext a r ound t he docu ment .
Inse rt E nd note
-
( Alt + C tr l + D). Ins er t s a n endnot e a t t he end of t he docu ment . End not es a r e a lwa
ys
pla
c ed a t t he end of a docu ment .
NextFoot note
S how Notes
CS101
VU
P ag e
342
of
3 81
209.
Displa ys
t he "S pel l ing a nd Gr a mma r " dia l og box. T his a llows you t o c hec k t h e
spel li ng a nd gr a mma r i n t he a ct i ve docu ment .
T hes aur us
T oggl est hedisp la yoft heR es ea r cht a skpa nedefa ult i ngt her es ea r chs er vi c et ot het
hesa ur us.
S a me a s Excel.
WordCo unt
T his
displa yst he"W or dC ount "dia l ogb oxdisp la yingt hedocu ment st a t ist ics. T hisr epla c
es
t he W or d C ou nt t oolba r . T his dia log b ox ca n a lso b e di spla yed b y c l ic ki ng on t he
wor d c ou nt i ndi ca t or on
t he st a t us bar.
Intr oduct i on t o Com put in g
CS101
VU
P ag e
343
of
3 81
210.
Word Process i ng: MS Word (L ang uage
G ro up i n R eview R ib bo n)
Fi gure
192
: L anguage group
T rans l ate
Dr op
-
D own. Displa ys t he R es ea r ch t a sk pa ne. T his dr op
-
down c ont a ins t he c omma nds :
Tr a nsla t
e Docu ment , Tra nsla t e S el ect ed T ext , Mini T ra nsla t or a nd C hoos e T ra nsla t ion
La ngua ge.
L ang uag e
-
Dr op
-
Down. T his dr op
-
down c ont a i ns t he comma nds : S et Pr oof i ng La ngua ge a nd La ngua ge
P r ef er enc es. S et Pr oof i ngLa ngua ge disp la yt he"La ngu a ge"dia l ogbox. La ng
ua geP r ef er enc es disp la yst he
"Opt i ons " dia l og box, La ngua ge T a b.
CS101
VU
P ag e
344
of
3 81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
211.
Fi gure
193
: C omment sgrou
p
New Co mme nt
Del ete
-
But t on wit h Dr op
-
D
own. Del et es t he s el ect ed comment . T he but t on del et es t he c om ment i n t he
a ct ive s el ect i on. T he dr op
-
down c ont a i ns t he c omma nds: D el et e Al l C omm ent s S hown a nd D el et e a ll
com ment s in D ocu ment . T his is disa bl ed when t he doc u ment does not c ont a in a ny
c omment s.
Pr evio us
Goest ot hepr evi ouscom ment int hea ct i vedocu ment . T hisisdisa bl edwhent he docu
ment does
not cont a i n a ny com ment s.
Next
Goes t o t he next comment i n t he a ct ive docu ment . T his is disa bled when t he docu
ment does not
cont a i n a ny com ment s.
Intr oduct i on t o Com put in g
CS101
VU
P ag e
345
of
3 81
212.
Word Process i ng: MS Word (T rac ki ng and C hange s G roups i n R evi ew Rib bo n)
Fi gure
194
: T racki nggroup
T rac k C hanges
(C tr l + S hift
+ E). But t on wit h Dr op
-
Down. T he but t on is t he Tra ck C ha nges c omma n d
fr om t he R evi ewi ng. It cont a i ns t he c omma nds T ra ck C ha nges, C ha nge T ra cki ng
Opt i ons a nd C ha ng e
Us er na me
. C ha nge T ra cki ng Opti ons displa ys t he T ra ck C ha nges Opti ons dia l og box. C ha nge
Us er na me
S how M ar kup
-
Dr op
-
D own. T he dr op
-
down c ont a ins t he c omma nds : C omm ent s, Ink, Ins er t i ons a nd
Del et i ons, F or ma t t ing, Mar kup Ar ea Hi ghli ght .
Revie wi ng Pane
But t on wit h Dr op
-
D own. T he but t on t oggl e
s t he displa y of t he R evi ewi ng pa ne. T he
dr op
-
down c ont a ins t he c omma nds : R eviewi ng P a ne Ver t ica l a nd R eviewi ng P a ne Hor i
z ont a l l y. T her e i s
now a lso su mma r y i nfor ma t i on a t t he t op of t he pa ne.
Fi gure
195
: C hanges group
Acce pt
-
Butt on wit hDr op
-
D own. T hebutt onist he Ac c epta ndMovet oN extcomma ndwhic ha cc epts t he
cur r ent cha nge a nd moves t o t he next pr opos ed c ha nge. T he dr op
-
down c ont a ins t he com ma nds
: Ac c ept
a nd Move t o Next , Acc ept C ha nge,
a ccept
Rejec t
But t on wit h Dr op
-
D own. T he but t on is t he R ej ect a nd Move t o N ext c omma nd whi c h r ej ect s t h e
cur r ent c ha ngea ndmovest ot henext pr opos edc ha nge. T hedr op
-
downcont a i nst hec omma nds:R ej ect a nd
Move t o N ext, R ej ect C ha nge,
r ej ect
a ll C ha nges S hown a nd R e
j ect a ll C ha nges i n Docu ment . T his dr op
-
down is disa bl ed when t he docu ment is pr ot ect ed.
Pr evio us
Movest ot hepr evi ousr evisi on i nt hea ct i ve docu ment . T hisisa bit c onfusi nga sit does
exa ct l y
t he sa me a s t he P r evi ous i n t he c omment s gr oup.
Next
Mov
es t o t he next r evis i on i n t he a ct i ve docu ment .
CS101
VU
P ag e
346
of
3 81
213.
Word Process i ng: MS Word (Co mp ar e and Prote ct G roups i n R evi ew Ri bbo n)
Fi gure
196
: C ompare group
Co
mp are
Dr op
-
D own. T he dr op
-
down c ont a i ns t he com ma nds: C ompa r e a nd C ombi ne. T he C ompa r e
com ma nd l et s you c ompa r e t wo ver si ons of t he sa me docu ment a nd disp la ys t he
"C ompa r e D ocu ment s "
dia l og box. T he C omb i ne c omma nd l et s you comb i ne r evisi ons fr om mu lt ipl
e a uthor s a nd displa ys t h e
"C ombi ne D ocu ment s " dia l og box. T his dr op
-
down is disa bl ed when t he docu ment is pr ot ect ed.
B loc k A ut hors
Dr op
-
D own. Pr event ot her s fr om ma ki ng cha nges t o t he s el ect ed t ext .
Restr ic
t E d it i ng
-
T oggl es t he displa y of t he R est r ict Edit i ng t a sk pa ne.
T he dr op
-
down c ont a i ns t he c omma nds : Unr est r ict ed Acc ess, R est r ict ed Acc ess,
Ma na ge C r edent ia ls.
Fi g
ure
197
: Prot ect group
CS101
VU
P ag e
347
of
3 81
214.
T heVi ewr ibb onc ont a i nsVi ewsgr oup, S howGr oup, ZoomGr oup, a ndWi ndowsgr oup.
T heVi ewsgr oup
cont a i ns a ll t he c omma nds r ela t i ng t o t he dif f er ent wa ys you ca n vi ew your docu
ment s a s shown i n t h e
F igur e
255. 255.
198.
Fi gure
198
: Vi e ws
group
Read Mode
Pr i nt L ayo ut
Web L ayo ut
O ut l i ne
-
Displa ys t he docu ment a sa n out l i ne is disp la ys t he Out l i ni ng c ont ext ua l t a b.
Draft
Displa ys t he docu ment i n dr a ft mode a l l owi ng f or quic k edit i ng. When usi n
g t his view c er t a i n
a spect s of t he docu ment a r e not vis ibl e, f or exa mpl e a ny hea der s or foot er s.
Fi gure
199
: Show group
R ul er
T oggl es t he disp la y of t he
r ul er (s).
G rid l i nes
Fi gure
200
: Z oomgroup
CS101
VU
P ag e
348
of
3 81
Zoo m
100%
r et ur n t o 100 %.
O ne Page
-
Adjust t he z oom so a n ent ir e pa ge fit s i n t he a ppli ca t ion wi ndow.
T wo Pages
PageWi dt h
T he Wi ndows gr oup ha s been shown i n t he F i gur e 201. Ever y docu ment you op en i n
Wor d ca n b e t hought
of a s a wi ndow. It is poss ibl e t o op en mu lt ip l e wi ndows of t he sa me docu ment .
Fi gure
201
: W indows group
New Wi ndow
Arr angeAl l
-
T il ea llt heop enwi ndowssi debyside ont hescr een. T hiswil la lso
ma xi miz e
S pli t
-
T oggl es t he sync hr oni z e scr oll i ng of t he t wo docu ment s t ha t ar e disp la yed si de
by si de. T his is only ena bl ed when
Dr op
-
D own. Let syous wit chb et weena l lt hecur r ent l ya ct i vedocu ment s. T hisdispla ys
a ll t he window/ docu ment s t ha t ar e curr ent l y op en i n t he par t icula r sess i on.
VU
P ag e
349
of
3 81
215.
Prese nt at io ns: MS
-
Powe r Poi nt (I nt rod uct io n)
Micr os oft of f er s a not her power fu l t ool known a s MS
-
P ower P oi nt . T his is used t o devel op pr es ent a t i ons.
Micr os oft P ower P oi nt is a n ea sy pr ogr a m t o use a nd a power fu l t ool for gi vi ng a
pr es ent a t ion. Whet her
your pr es ent a t ionneedsavisua lkic k, t oolsfor co
lla bor a t ion, ea sya ccess or t hea bil it yt osha r einfor ma t i on
beyond t he i nit ia l me et i ng, P ower P oi nt is a good opt i on. It ca n even help r educ e
sp ea ki ng a nx i et y b y
dr a wi ng eyes a wa y fr om t he sp ea ker a nd t owa r ds a screen. Jus t do not exp ect t
his t echnol ogy t o
subs t it ut e
for sound a nd dyna mic sp ea ki ng skil ls. All r ibbons of MS P ower p oi nt a r e shown i n t
he F i gur e 202.
Fi gure
202
: MS: Po werpoi nt
modu l es.
Intr oduct i on t o Com put in g
CS101
VU
P ag e
350
of
3 81
216.
Prese nt at io ns: MS
-
Powe r Poi nt (S l ides G ro up on H o me R ib bo n)
Fi gure
203
: Sl i des gr ou p i n home r i bb on
New S li de
Butt o
n wit h Dr op
-
D own. T he butt on i ns er t s a new bla nk T it l e a nd C ont ent S li de. T he dr op
-
downc ont a inst hes l i des:T it l eS l i de, T it l ea ndC ont ent , Duplica t eS el ect edS li des, S
li desfr omOut l i nea nd
R eus e S li des.
L ayo ut
Dr op
-
D own. T he dr op
-
down c ont a i ns t he c om
ma nds : T it l e S li de a nd T it l e a nd C ont ent .
Reset
Del ete
217.
Prese nt at io ns: MS
-
Powe r Poi nt (Des ig n Ribbo n)
T hedes i gnr ibbonist her ibbont ha thelpsyout odesi gnyour slidesa sper your r equ ir
ement . T hefir st gr oup
pr es ent a t ion. You ca n t r y di ff er ent t hemes t o
see t he di f f er enc e.
Fi gure
204
: T hemes group
CS101
VU
P ag e
351
of
3 81
218.
Prese nt at io ns: MS
-
Powe r Poi nt (T r ans it io n Ribbo n)
Ifyou' ve ever s eena P ower P oi nt pr es ent a t iont ha t ha dspecia l eff ect sbet ween ea c
hsl i de, you' ves een
sl id e
tr ans it io ns
. A t r a nsit i on ca n b e a s si mp l e a s fa di ng t o t he next sl i de or a s fla shy a s a n eye
-
ca t chi ng ef f ect .
P ower P oi nt ma kes it ea sy t o a ppl y t r a nsit i ons t o som e or a ll of your sli des, gi vi
ng your pr es ent a t ion a
polis hed, pr of ess i ona ll ook. T het ra nsit i onr ibbonh
260. 260.
205.
Fi gure
205
: T ransi t i on group
Onc e you a r e done wit h one t yp ica l t ra nsit i on st yl e, t he next t hi ng is t o c onf i gur
e ot her opt ions a va i la bl e
i n t he F i gur
e 206.
S ound
You ca n a dd a ny sou nd fi l e over her e whic h you need t o pla y i n t his t r a nsit i on
D ur at io n
App ly to All
Fi gure
206
: T ransi t i on t i mi ng group
CS101
VU
P ag e
352
of
3 81
219.
Prese nt at io ns: MS
-
Powe r Poi nt (A ni mat io n R ib bo n)
Tr a nsit ion
discuss edi nt he la st modu l e
Fi gure
207
: Animati ons group
CS101
VU
P ag e
353
of
3 81
220.
Fi gure
208
: Spread Sheet Exampl e
If you wa nt t o sel ect a par t icula r cel l, you wi l l ha ve t o i dent if y it s a ddr ess . T he
sel ect ed c ell i n t he F i gur e
263. 263.
CS101
VU
P ag e
35
4
of
3 81
Fi gure
209
: Excel L ayout
Cel l Fo r matt i ng
C harts
C ha r t sa llow you t o pr es ent inf or ma t i on cont a i ned i n t he wor ksheet in a gra phic
f or ma t . Excel off er s ma n y
t yp es of c ha r t s inclu di ng: C olu mn, Line, P i e, Ba r, Area , S cat t er a nd mor e. T o vi
ew
t he cha r t s a va ila bl e
cl ic k t he I ns er t Ta b on t he R ibb on.
C r ea t ing a C har t :
Fi gure
210
: C el l f ormatt i ng
Intr oduct i on t o Com put in g
CS101
VU
P ag e
355
of
3 81
C lic k
t he I ns er t t a b on t he
R ibb on
211.
Fi gure
211
: C harts group
T his cha r t ha s four comp onent s a nd you ca n r ight cl ock on t hem s epa ra t el y t o s
ee t he a dva nc e
opt i ons a va ila bl e.
Fi gure
212
: C hart exampl e i n Excel
221.
Fi gure
213
: Formula
Exampl e
CS101
VU
P ag e
356
of
3 81
T he f or mu la r ibbon is shown i n t he F i gur e 214. T his r ibbon gi ves you di ff er ent opt
i ons f or a pplyi n g
for mu la s. T he fir st sect i on r epr es ent s F unct i on l ibr ar y. F unct ion l ibr a r y cont a
i ns
di ff er ent for mula s fr om
va r ious ca t egor i es. F igur e 214 gi ves you a n over vi ew of t he F or mu la r ibbon.
Fi gure
214
: Formula ri bbon
Cre at i ng B as ic Fo r
mul a
Fi gure
215
: Dat af or Sum F
ormula
T o cr ea t e a ba sic
for mula ,
S el ect t he c el l f or t he f or mu la
T he f or mula is of su m whi c h wou l d su m t he va lu es.
C lic k E nt er
Fi gure
216
: Sum Formula
CS101
VU
P ag e
357
of
3 81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
Fi gure
217
: Resul t of Sum Formula
Calc ul at e wit h
Func t io ns
Afu nct i onisa built inf or mu la inExc el. Afunct i onha sana mea nda r gument s(t he ma t
hema t ica lfu nct i on)
i n pa r ent hes es.
Ma x: F inds t he ma x i mu m va lu e
C hoos e t he funct i on
C lic k OK
Fi gure
218
: Funct i on C omput at i on
CS101
VU
P ag e
358
of
3 81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
222.
Fi gure
219
: Sum of marks
CS101
VU
P ag e
359
of
3 81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
223.
T he F i gur e 221 cont a i ns t he p er sona l exp ens es det a i ls of t he yea r 2020 mont h
wis e i n di ff er ent hea ds.
Fi gure
221
: Pers onal expen
se sheet
Now our fir st qu er y is t o s ee t he t ot a l exp ens e f or t he J a nua r y mont h. T he a ppl i
ed f or mula ca n b e s een i n
t he F i gur e 222 a nd it s r esult ca n b e seen i n t he F i gur e 2 23.
Fi gure
222
: Fi ndi ng t otal expense f or
t he January mont h
CS101
VU
P ag e
360
of
3 81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
Fi gu r e
223
: Resul t of queryf rom Fi gure 222
Fi gure
224
: T ot al bil l Expense
-
head wi se
S i mila r l y,
= mi n(b3: b14)
CS101
VU
P ag e
361
of
3 81
224.
B asic S ort
To
ex ecut e a ba s ic des c endi ng or a s cend i ng s or t bas ed on on e c olu mn p er f or m t he
fol l owi ng s t eps :
Hi ghl i ght t he c el ls t ha t wi ll b e sor t ed
T hes
e st eps a r e shown i n t he F i gur e 225.
Fi gure
225
: Sort and Fi l t er
C ust om S or t
C lic k OK
CS101
VU
P ag e
362
of
3 81
Fi gure
226
: C ust om Sort
CS101
VU
P ag e
363
of
3 81
225.
Fi gure
227
: MS Access ri bb
on
T o cr ea t e a new da t a ba se
C lic k on Bla nk da t a base opt i on a s shown i n F i gur e 228
C lic k C r ea t e but t on t o cr ea t e da t
a ba se. (F igur e 229).
Fi gure
228
: C reat e Blank Dat abase
CS101
VU
P ag e
364
of
3 81
Fi gure
229
: N aming and savi ngdat abase
When your da t a ba seiscr ea t ed new wi ndowscr eena ppea r a ndb y defa ult t a bl e isa
dded. Ont he l eft s i de of
t he wi ndow is na vi ga t i on pa nel (F i gur e 230) her e you wi ll s ee a ll your sa ved t a
bles, for ms, qu er i es a nd
r epor t s. On t he R ight of t he na vi ga t i on pa ne i
s wor ki ng or vi ew pa nel. You ca n vi ew t a bl e da t a , quer y
out put , gener a t e r ep or t s a nd for m her e.
Fi gure
230
: Blank Dat abase
E xter nal d at a
Exter na lda t a ta bisusedt oi mp or t ,expor t , col l ect a ndsha r eda t a bet ween di ff er ent
da t a ba ses. Youca na lso
exp or t a nd i mp or t da t a fr om ex c el docu ment a s shown i n t he F i gur e 231.
Fi gure
231
: Ext ernal dat a
Ribbon
CS101
VU
P ag e
365
of
3 81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
226.
C r ea t eTa bint heR ibb onhelpsyout opr ovi dequi c ka ndea sywa yt ocr ea t et a bles, for
ms, r epor t a ndqu er i es
a sshown i n t he F igur e 232.
Fi gure
232
: C reat e tab
T ab les G ro up
Ta bles i n Ac c ess a r e
used t o st or e da t a . It is a set of c ol u mns a nd r ows. Ea ch colu mn i n t a ble is r ef er r
ed t o
a sa fiel d. Ea ch va lu e i n t he f i el d si gnif i es a singl e t yp e of da t a. Numb er s of R ec
or d a r e nu mb er of r ows i n
a Ta ble henc e ea c h r ow of a ta ble is r ef er r ed t o a sa sing
l e r ec or d.
1.
2.
273. 273.
3.
274. 274.
4.
R ena me t he
275. 275.
5.
6.
277. 277.
7.
278. 278.
8.
Add a new f
279. 279.
9.
10.
11.
12.
13.
C los e t a ble.
CS101
VU
P ag e
366
of
3 81
227.
232.
1.
2.
C lic k C r ea t e t a b.
288. 288.
3.
4.
A F or m wi l l be cr ea t ed wit h T a ble F i el ds a s
La bels fol l owed b y T ext Box es (F i gur e 233)
290. 290.
5.
291. 291.
6.
292. 292.
7.
Fi gure
233
4: Saved Form " student Form"
CS101
VU
P ag e
367
of
3 81
228.
1.
C lic k C r ea t e t a b.
296. 296.
3.
4.
A R ep or t
wil l b e gener a t ed a s shown i n F i gur e 236.
298. 298.
5.
299. 299.
6.
300. 300.
7.
8.
Fi gure
234
: Insert Report
Fi gure
235
: St udent T abl e Report
CS101
VU
P ag e
368
of
3 81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
229.
Dat ab ase: MS
Access (Q uery Wi zard )
Fi gure
236
: Query Group: Q
ueryW i zard
Que ry T ypes
Ta ble 1: Ba si c Quer i es
Q ue ry
Descr ipt io n
G ener ic S Q L S ynt ax
S elect
Us ed t o r et r i ev e
sel ect ed da t a one or
mor e f i el d ca n b e
sel ect ed by using
com ma a s sep er a t or or
use * t o s el ect a ll t a bl e
fi el ds, foll owedb yt a ble
na me fr om wher e t h e
da t a is t o be r et r i eved.
You ca n a lso a dd
W
HER E cla use t o set
cr it er ia for sel ect i on.
S ELECT
F R OM
t a ble_ na me1, t a bl e_na me2;
OR
S ELECT * F R OM
t a ble_ na me, t a ble_ na me2;
OR
S ELECT *F R OM
t a ble_ na me, t a bl e_na me2
WHER E some cr it er ia ;
Ins er t
Us ed t o a dd new
r ec or ds.
Up da t e
Us ed t o upda t e exist i ng
r ec or ds i n da t a ba se.
Gi ven some cr it er ia in
WHER E cla use.
UP D AT E ta ble_ na me
S ET fiel d1= newva lu e1,
fi el d2= newva lu e2
Del et e
Us ed t o r emove da t a
fr om da t a ba se.
DELET EF R OM
t a ble_ n
a me WHER E
some cr it er ia ;
Q ue ry S tude nt T ab le us i ng Wi zard
303. 303.
1.
2.
CS101
VU
P ag e
369
of
3 81
3.
Anot her window wil la ppea r . S el ect t a blefr om whi c hyouwa nt t oqu er y
r esult si nour ca seit ist h e
st udent t a ble.
306. 306.
4.
5.
6.
B ef or e you cl ic k fi nis h
ent er i ng
t he na me you wa nt t o gi ve your qu er y. F or
exa mp l e,
309. 309.
7.
Your qu er y wi llb er epr es ent ed i na t a blef or m wit ht wosel ect edf i el dsst udent na
mea nds emest er .
310. 310.
8.
Fi gure
237
: C reat i ng Query usi ng wi zar d
Fi gure
238
: Query Resul t af t ersavi ng
VU
P ag e
370
of
3 81
Q ue ry Desig n V iew
Fi gure
240
: SQL Vi ew Query Synt ax
1.
2.
3.
You ca n a dd mu lt ip l e t a bl es t o p er for m qu er y a s wel l for si mp l ic it y we wi ll us e
one t a bl e, c li c k
Add a nd t hen cl os e.
314. 314.
4.
5.
6.
CS101
VU
P ag e
371
of
3 81
7.
In t he cr it er ia box of t he f i el d ss ems t yp e 3.
318. 318.
8.
9.
Fi gu r e
242
: C reat e Query Usi ng Desi gn Vi e w
CS101
VU
P ag e
372
of
3 81
Mod ule 23
0
320. 320.
230.
In t his modul e, you wil l l ea r n wha t is web pa ge, how it ca n be devel op ed usi ng not
epa d edit or .
What is a Webp ag e?
Hyp er T ext Mar kup La ngua ge is a ma r kup la ngua ge t ha t web br ows er s use t o int er
pr et a nd comp os e t ext ,
i ma gesa ndot her ma t e
r ia li nt ovisua lor a udibl e webpages. Defa ult cha r a ct er ist icsfor ever yit emofHTML
ma r kupa r edefi nedi nt hebr ows er . T hepur poseofawebbr ows er ist or ea dHT MLdocu
ment sa ndcomp os e
t hem i nt o visib l e or a udibl e web pa ges. Whenever you op en a HTML doc
u ment i n a web br ows er , t he web
br ows er does not disp la y t he HT ML ta gs, but uses t he t a gs t o int er pr et t he c ont
ent of t he pa ge.
HT MLel ement sfor mt hebuil di ngbl oc ksofa llwebs it es.HT MLa ll owsi ma gesa ndobj ect
st obeemb edde d
a ndca nb eus edt ocr ea t e
i nt er a ct ive f or ms. It pr ovi desa mea nst ocr ea t est r uct ur eddocu ment sby denot in g
st r uct ura lsema nt i csf or t ext suc ha shea di ngs, par a gra phs, l ist s, li nks, qu ot esa ndot
her it ems. It ca n emb e d
scr ipt s wr it t en i n la ngua ges such a s Ja va S cr ipt whi c h a ff ect t
he b eha vi or of HT ML web pa ges.
321. 321.
1.1
H T ML E le me nts:
AnHT MLel ement ha sa sta rt inga nd endi ngt a g. C ont ent ispla cedbet weenst a r ta
ndendt a g. Element sca n
ha ve va r ious a t tr ibut es.
322. 322.
1.
T he t ext bet ween t a gs <ht ml> a nd </ ht ml> descr ib es t he st a r ta nd end of web
pa ge.
323. 323.
2.
3.
T he t ext bet ween t a gs <h1> a nd </ h1> is pr es ent ed a s a fir st hea di ng.
325. 325.
4.
T het ext b et weent a gs<p>a nd</ p>ispr es ent ed oft he pa gea sonepa r a
gr a ph. Ea cht a gha sa sta t ing
t a g a nd a n endi ng t a g. S ome exc ept i ons a r e t her e whi c h wi l l be discuss ed la t er .
Inl i neel em ent sa r eusua llydisp la yedont hebr ows er wit hout st ar t inga newl i ne. Exa
mpl es:<b>, <t d>,<a >,
<i mg>
HT ML At t r ibutes
E xa mp le:
CS101
VU
P ag e
373
of
3 81
i mg is
el ement .
siz es of t he i ma ge.
1.
not epa d
327. 327.
2.
Fi gure
243
: HT ML code i n
N ot epad
328. 328.
3.
Fi gure
244
: Savi ng as ht ml page
Doub l e cl i ck on t ha t ht ml f i l e a nd op en wit h a
ny of i nst a ll ed br ows er s. T he i c on wil l a ppea r as shown i n
t he F i gur e 245.
Fi gure
245
: Fi rs t web page out put
Intr oduct i on t o Com put in g
CS101
VU
P ag e
374
of
3 81
Mod ule 23
1
329. 329.
231.
Web page Deve lop me nt (I ntro d uct io n to Dre amwe aver)
edit or s a r e used.
H T ML editor
is a soft wa r e a pplica t i on f or cr ea t i ng web pa ges, spec ia li z ed HT M L edit or s ca n
off er
conveni enc e a nd a dded funct i ona lit y. F or exa mpl e, ma ny HT ML edit or s wor k not
onl y wit h HT ML, but
a lso wit h r ela t ed t ec hnol ogi es such a sC SS
wewil lbegoi ngt hr ou ghabasici nt r odu ct i onofAdob eDr ea mwea ver . Alt houg h
t her ear esever a lot her HT MLedit i ngt oolsa va ila bl e, weha vec hos ent hist oolbeca us
eit isa mongt he most
com monl y us ed t ool f or pr ofess i ona l web devel op men
t.
Adob eDr ea mwea ver isawebdes i gna nddevel op ment appli ca t iont ha t pr ovi desa visua
lWYS IW YGedit or
(Wha t You S ee Is Wha t You Get ) a nd a code edit or wit h st a nda r d f ea t ur es such a s
synt a x highl i ght i ng,
code c omp l et i on, a nd c ode c ol la psi ng a s wel l a s mor e
f oot ba ll ca n c omp l et el y r ep la c e a
ma n
-
ma de
f oot ba ll A ma c hi ne ma d e
foot ba l l ca n ma ke good qua nt it y of f oot ba lls i n a com mer cia l pr oduct i on however ,
it ca nnot a chi eve t h e
dur a b
il it y a nd p er f ect i on of a ma n ma de f oot ba l l. As you ma y know, ma n
-
ma de f oot ba lls fr om S ia l kot a r e
st il l bei ng us ed i n i nt er na t i ona l t our na ment s even t hou gh we ha ve t he c hoi c e of
ma chi ne
-
ma de
f oot ba lls.
Dr ea mwea ver , li ke t he ma c hine t ha t ma kes foot ba l l, is des i gned t o ma ke your lif
e ea si er . You ma y never
Dr ea mwea
ver i nt er fa c e ha s been shown i n t he F igur e 246.
CS101
VU
P ag e
375
of
3 81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
Fi gure
246
: Dreamweaver i nterf ace
T heDoc u me nttoo lb ar :
C ont a i nsbut t onst ha t pr ovi deopt i onsf or di ff er ent vi ewsoft heD ocu ment wi ndow
(such a s Des i gn vi ew a nd
C ode vi ew), va r i ous vi ewi ng opt i ons, a nd some c ommon op er a t ions such a s
pr evi ewi ng i n a br ows er .
> T oolba r s >S t a nda r d. T he t oolba r cont a i ns but t ons f or common op er a t ions fr
om t he F i l e a nd E dit menus
ver y s i mi la r t o MS Wor d: N ew, Open, Br ows e i n Br i dge, S a ve, S a ve Al l, Pr int C
ode, C ut , C opy, P ast e,
Undo, a nd R edo.
Desig n vi ew:
A desi gn envir onment for visua l page la yout , visua l edit i ng, a nd ra pid a pplica t i on
devel op ment . In t his vi ew, Dr ea mwea
ver disp la ys a full y edit a bl e, visua l r epr es ent a t i on of t he docu ment ,
si mi la r t o wha t you would s ee when viewi ng t he pa ge i n a br ows er .
Code view :
A ha nd
-
c odi ng envir onment for wr it i ng a nd edit i ng HT ML, Ja va S cr ipt ,
CS101
VU
P ag e
376
of
3 81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
Fi gure
247
: Propert i es panel
Intr oduct i on t o Com put in g
CS101
VU
P ag e
377
of
3 81
Mod ule 23
2
330. 330.
232.
Fi gure
248
: Add new page
Now a dd HT ML pa ge a s shown i n t h
e F i gur e 249.
Fi gure
249
: Adding HT ML page
CS101
VU
P ag e
378
of
3 81
Fi gure
250
: N ami ng t he page
Fi gure
251
: Insert T able
Fi gure
252
: Rows and col umns
CS101
VU
P ag e
379
of
3 81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
Fi gure
253
: Adjus ti ng row si zes
CS101
VU
P ag e
380
of
3 81
C opy rig htVi rtual U ni v ersi ty ofP aki stan
Mod ule 23
3
331. 331.
233.
Bul l et ed l ist s mi ght b e fa mi lia r t o you if you ha ve wor ked wit h wor d pr oc ess i ng
or des kt op pub lis hi ng
a pplica t i ons. List s ar e a helpfu l wa y t o pr es ent i nf or ma t ion t o
a r ea der wit hout t he f or ma l c onst r a int s of a
pa ra gra ph. T heya r eesp ec ia l l yi mp or t a nt ont heW eb. S tudi esi ndica t et ha t peop l
et yp ica l l yski mwebpa ges
i nst ea d of r ea di ng t hem fr om b egi nni ng t o end. Cr ea t ing l ist s wi ll ma ke it ea si er
for your vis it or s t o g
et t he
most fr om your websit e wit hout sift i ng t hr ou gh sever a l pa ra gra phs of t ext .
On t he
event s. ht ml
pa ge, cl ic k a nd dr a g t o highli ght t he t ext whi c h you wa nt t o put in t he l ist .
Fi gure
254
: Adding unorder
ed li st
C lic k t he Or der ed List but t on t o t he r i ght of t he Unor der ed List but t on. T he bul l
et s cha nge t o s eq
u ent ia l
nu mb er s.
C hoos e F or ma t > List > Pr oper t i es t o op en t he L ist Prop er t i es dia l og box. C hoos
e Bul l et ed L ist fr om t h e
List t ype dr op
-
down menu t o r et ur n t o your fir st st yl e of list . T he Nu mb er ed List a nd Bull et ed L
ist opti ons
i n t he List t yp e dr op
-
down
menu a lso a l low you t o swit ch b et ween or der ed a nd u nor der ed l ist s.
F r om t he S t yl e dr op
-
down menu (s ee F i gur e 255), choose S qua r e. T his cha nges t he defa ult cir cula r
bull et s t o s qua r e bull et s. C lic k OK t o exit t he L ist P r oper t i es dia l og b ox.
Fi gure
255
: L i st of propert i es
CS101
VU
P ag e
381
of
3 81
Mod ule 23
4