Homewooork PDF
Homewooork PDF
ﺪﺫﻤ
ﺪﻣﺤ
ﯿﺳ:
ﻡﺎ
ﻧ
ﻤﻦ
ﺪﭼﯿ
ﺳ:ﭘ
ﺭ
ﻡﺪﺎ
ﻧ
i
seﻭﻝ
ﺍﺮﺘ
ﻤﺴﻭﻝﺳ
ﺍﻨﻒ
ﺻ
Fi
l
lthebl
anks
1.Comput
erscandomanydi
ff
erentj
obsbecauset
heycanbepr
ogr
ammed.
2.Thej
oboft
heCPUi
stof
etchi
nst
ruct
ions,
car
ryoutt
heoper
ati
ons
commandedbyt
hei
nst
ruct
ions,
andpr
oducesomeout
comeorr
esul
tant
i
nfor
mat
ion.
3.I
nter
nal
l
y,t
heCPUconsi
stsoft
hecont
rol
uni
tandt
hear
it
hmet
icl
ogi
c
uni
t.
4.Ahar
ddr
ivei
sanexampl
eofasecondar
yst
oragedev
ice.
5.Thet
wogener
alcat
egor
iesofsof
twar
ear
esy
stem sof
twar
eand
appl
i
cat
ionsof
twar
e.
6.Apr
ogr
am i
sasetofi
nst
ruct
ions.
7.Si
ncecomput
erscan’
tbepr
ogr
ammedi
nnat
ural
humanl
anguage,
al
gor
it
hmsmustbewr
it
teni
napr
ogr
ammi
ngl
anguage.
8.Machi
necodei
stheonl
ylanguagecomput
ersr
eal
l
ypr
ocess.
9.Hi
gh-
lev
ell
anguagesar
ecl
oset
othel
evel
ofhumansi
nter
msof
r
eadabi
l
ity
.
10.Low-
lev
ell
anguagesar
ecl
oset
othel
evel
oft
hecomput
er.
11.Apr
ogr
am’
sabi
l
ityt
orunonsev
eral
dif
fer
entt
ypesofcomput
ersy
stemsi
s
cal
l
edpor
tabi
l
ity.
12.Wor
dst
hathav
especi
almeani
ngi
napr
ogr
ammi
ngl
anguagear
ecal
l
ed
key
wor
d.
13.Wor
dsornamesdef
inedbyt
hepr
ogr
ammerar
ecal
l
edVar
iabl
e.
14.Oper
ator
sar
echar
act
ersorsy
mbol
sthatper
for
m oper
ati
onsononeor
mor
eoper
ands.
15.Del
i
mit
ersar
echar
act
ersorsy
mbol
sthatmar
kthebegi
nni
ngorendi
ngof
pr
ogr
ammi
ngst
atement
s,orsepar
atei
temsi
nal
i
st.
16.Ther
ulest
hatmustbef
oll
owedwhenconst
ruct
ingapr
ogr
am ar
ecal
l
ed
sy
ntax
.
17.Av
ari
abl
eisanamedst
oragel
ocat
ion.
18.Av
ari
abl
emustbedecl
aredbef
orei
tcanbeusedi
napr
ogr
am.
19.Thet
hreepr
imar
yact
ivi
ti
esofapr
ogr
am ar
einput
,pr
ocessi
ng,
and
out
put
.
20.I
nputi
sinf
ormat
ionapr
ogr
am gat
her
sfr
om t
heout
sidewor
ld.
21.Out
puti
sinf
ormat
ionapr
ogr
am sendst
otheout
sidewor
ld.
22.Af
lowchar
tisadi
agr
am t
hatgr
aphi
cal
l
yil
l
ust
rat
est
hest
ruct
ureofa
pr
ogr
am.
ﻭ
ﻓﺼﻞﺩ
Fi
l
lthebl
ank
.
Ever
ycompl
etest
atementendswi
thasemi
col
on.
1
.
Tousecoutst
atement
syoumusti
ncl
udet
hei
ost
ream f
il
einy
ourpr
ogr
am .
2
.
Ever
yC++pr
ogr
am musthav
eaf
unct
ionnamedmai
n.3
.
#Pr
epr
ocessordi
rect
ivesbegi
nwi
tha.
4
Agr
oupofst
atement
s,suchast
hebodyofaf
unct
ion,
mustbeencl
osedi
n.5
.
cur
lybr
aces
.
A',
and"
Hel
l
oWor
ld"ar
eal
lexampl
esofchar
',
72.
6
.
woul
dbewr
it
teni
nEnot
ati
onas9.
7865E1412^
10×978.
65.
7
Thechar
act
erconst
ant'
A'r
equi
res1by
teofmemor
y,wher
east
hest
ri
ng.
8
.
const
ant"
A"r
equi
res2by
tes
?
Whi
choft
hef
oll
owi
ngar
enotv
ali
dassi
gnmentst
atement
s.9
;
A)t
otal
=9
;
B)72=amount
;
C)y
our
Age=my
Age
I
fthev
ari
abl
elet
terhasbeendef
inedasacharv
ari
abl
e,whi
choft
he..
10
?
fol
l
owi
ngar
enotv
ali
dassi
gnmentst
atement
s
;
A)l
ett
er=w
;
'
B)l
ett
er='
w
;
"C)l
ett
er="
w
11.Whi
choft
hef
oll
owi
ngar
enotv
ali
dcoutst
atement
s?
A)cout<<"
Hel
l
o"<<endl
;
B)cout<<"
Hel
l
o"<<\
n;
C)cout<<Hel
l
o;
12.Whi
choft
hef
oll
owi
ngar
enotv
ali
dcoutst
atement
s?
A)cout<<"
Hel
l
owor
ld"
;
B)cout<<Hel
l
owor
ld;
C)cout<<"
Hel
l
o"<<"wor
ld"
;
13.Assumex=4,
y=7,
andz=2.Whatv
aluewi
l
lbest
oredi
nint
egerv
ari
abl
e
r
esul
tbyeachoft
hef
oll
owi
ngst
atement
s?
A)r
esul
t=x+y
;=11
B)r
esul
t=y*2;
=14
C)r
esul
t=y/z;
=3
14.Assumex=2.
5,y=7.
0,andz=3.Whatv
aluewi
l
lbest
oredi
nint
eger
v
ari
abl
e
r
esul
tbyeachoft
hef
oll
owi
ngst
atement
s?
A)r
esul
t=x+y
;
B)r
esul
t=y*2;
C)r
esul
t=y/z
A)r
esul
t=x+y
;=9
B)r
esul
t=y*2;
=14
C)r
esul
t=y/z=2
15.Wr
it
eaC++st
atementt
hatdef
inest
hedoubl
evar
iabl
est
emp,
wei
ght
,and
hei
ghtal
li
nthesamest
atement
?
doubl
etemp,
wei
ght
,hei
ght
;
16.Wr
it
eaC++st
atementt
hatdef
inest
hei
ntv
ari
abl
esmont
hs,
day
s,and
y
ear
sal
li
nthesamest
atement
,wi
thmont
hsi
nit
ial
i
zedt
o2andy
ear
s
i
nit
ial
i
zedt
o3?
i
ntmont
hs=2,
day
s,y
ear
s=3;
17.Wr
it
eassi
gnmentst
atement
sthatper
for
mthef
oll
owi
ngoper
ati
onswi
th
i
ntv
ari
abl
ei,
doubl
evar
iabl
esd1andd2,
andcharv
ari
abl
ec.
A)Add2t
od1andst
oret
her
esul
tind2.
B)Mul
ti
plyd2t
ime4andst
oret
her
esul
tind1.
C)St
oret
hechar
act
er'
K'i
nc.
D)St
oret
heASCI
Icodef
ort
hechar
act
er'
K'i
ni.
E)Subt
ract1f
rom i
andst
oret
her
esul
tbacki
ni.
d2=d1+2;
d1=d2*4;
c='
K'
;
i
=int
('
K'
);
i
--
;
18.Wr
it
eassi
gnmentst
atement
sthatper
for
mthef
oll
owi
ngoper
ati
onswi
th
i
ntv
ari
abl
ei,
doubl
evar
iabl
esd1andd2,
andcharv
ari
abl
ec.
I
ntI
Doubl
ed1,
d2;
Charc=‘
f'
;
ﻪ
ﻟﺖﻓﺼﻞﺳ
ﺍ
ﺍﻮﺳ
1.Assumeast
ri
ngobj
ecthasbeendef
inedasf
oll
ows:
str
ingdescr
ipt
ion;
A)Wr
it
eaci
nst
atementt
hatr
eadsi
naonewor
ddescr
ipt
ion.
B)Wr
it
east
atementt
hatr
eadsi
na.
A)ci
n>>name;
B)get
li
ne(
cin,
name)
;
2.Wr
it
eadef
ini
ti
onst
atementf
orachar
act
erar
rayl
argeenought
ohol
dany
oft
hef
oll
owi
ngst
ri
ngs:
"
Bil
l
yBob'
sPi
zza"
"
Downt
ownAut
oSuppl
i
es"
"
Bet
tySmi
thSchool
ofAr
chi
tect
ure"
"
ABCCabi
netCompany
"
Charst
r[50]="
Bil
l
yBob'
sPi
zza"
Charst
r[50]="
Downt
ownAut
oSuppl
i
es"
Charst
r[50]="
Bet
tySmi
thSchool
ofAr
chi
tect
ure"
3.
Assumet
hear
raynamei
sdef
inedasf
oll
ows:
charname[
25]
;
4.Assumet
hef
oll
owi
ngv
ari
abl
esar
edef
ined:
i
ntage;
doubl
epay
;
charsect
ion;
.ci
n>>age>>pay>>sect
ion;
5.Whatheaderf
il
esmustbei
ncl
udedi
nthef
oll
owi
ngpr
ogr
am?
i
ntmai
n()
doubl
eamount=89.
7;
cout<<f
ixed<<showpoi
nt<<set
preci
sion(
1);
cout<<set
w(8)<<amount<<endl
;
r
etur
n0;
}
#i
ncl
ude<i
ost
ream>
#i
ncl
ude<i
omani
p>
6.Wr
it
eadef
ini
ti
onst
atementf
orachar
act
erar
raynamedci
ty.I
tshoul
dbe
l
argeenought
ohol
dast
ri
ng30char
act
ersi
nlengt
h.
charci
ty[
33]