0% found this document useful (0 votes)
43 views20 pages

Data Structure Modern Operators and String

1. The document describes logical operators like OR, AND and NOT that can be used to check conditions. Functions like add() and orderPizza() are also described. 2. Restaurant menu items, opening hours and sample orders are defined as constants and arrays. Logical expressions are used to check conditions on the restaurant data like checking the number of guests or items in the menu. 3. Spread operators allow arrays to be expanded in function calls. Functions are defined to add numbers, return menu items and process orders. Logical operators are used to check multiple conditions in an expression.

Uploaded by

Water Vapour
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views20 pages

Data Structure Modern Operators and String

1. The document describes logical operators like OR, AND and NOT that can be used to check conditions. Functions like add() and orderPizza() are also described. 2. Restaurant menu items, opening hours and sample orders are defined as constants and arrays. Logical expressions are used to check conditions on the restaurant data like checking the number of guests or items in the menu. 3. Spread operators allow arrays to be expanded in function calls. Functions are defined to add numbers, return menu items and process orders. Logical operators are used to check multiple conditions in an expression.

Uploaded by

Water Vapour
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

Date /

Arm esmuchnin he cdeshuc kuing sig


a mates i poMiu.
Lynaai q JS expreion
npack alL how
tnd dihncF Vveuiablos.
souctm ino mplea_-pauks
break mle

Const arrL2,3,J

Cons CAzJ ar
Dexuchmin
Ao X:2j*3, 724
Nos xhachug opesk fom m_djec*

Consh restaurmmt : 2
eme Clamico Llaliamo
Caluoies: Ialian, izzeria Vesckauan Organt
shaata Monu focasdia Bruuhabta ', a l er
Caprae Salcd 'J,_
main Menu Yizza', PastaL RisotBo;

No Lonst Lsk,scusnd neaBrunnt.cakeies


Sist Lhalian stmdVueia
Nos jer L 3rd. leae 2nol a emph
Cons LAsthrd wpkzuuhamlt CakguiA.
A 2 2halan i d Ve9akuian

wapoin sing eatauchuin


Lb, a ]
w Cm op dtwfi iku

PageNo
Date
Saath)

mhoda

order : fumcioo ( stankea Tndix main hdo)


retunfhi StaakaMaau[staukandial, hin mainlMnu
LmeinIndex 1];

Cons cnakea nuaioj e eataunomt.oxdan l2,0)


no staalta Gaulic Bread maio za

NestedDestauckuing
Constnegled 2, 4, tS,L31;
Const iL,Lj KJ need

Exco elemenks

Congt Tg q r e s 9
Y2 Undo4saned

Desmuchuing_@bLecs=
addi ening haus a restamom obrect

Cen12
ds 22

chsse 23,

PageNo.
Saath
Date /-1-

Sati

clse:24

,openingHouns akgme ecotallkm


Cons e m e
aiano ,openingHou F Py Cozecks
Zame clamnico
cattnS
in CakgSris aMy o

name rBaUNOmlarme,_

Openin9Hrourg houy s,
0.
caesne Hags
y restau.amt
e Som
p0aaAramiiam hous us
0
pur

menu :LJ stanlea ndunu shanleas e restanant


Const
Euu will e slaaka Mr
monu l r e emphy aay

Cons
open close
Y operning Hours
Cpen 0penhoe A mday 1
clove cloingo me idoy ie 23.

ordenDelieup fusc hin stamlea Indox main Tndax


meaddrm })
Console ls7 ovdos ieceived Lhis. sueaMen gwkerjnd
PageNo.
Date

and his, nainManumain hd ox]}uill be AoienaA t


$ iaddreA at ¢ { lhme}'

me 222: 30
addrem Via.del. slo,21
mainàdix 224
sknuuIndtx 2

C_pulbig h 2nik relao ponamokuMie dojeck in


in umc im Call AiniKa
umc Bun4eanA
valu wl_e wed calinq valve

Sprea Opeako'
Spread oerakor ..) alloos on ikrable
Cuch _as an prenianc shingJo be expemded
place ohens z2r0 ormo aakumens |feo wcKm_calls
eloments fac amaay ilenaln) ane _expee.edcom
mobneck
eprtmDn be expamdod i n places hes za. moe.
key alue nis t w dheckleaab a expeeked
Cs arr = L}8,9)
Consneshr: ,2.arr

ConsneaMenue L estauuremtmain Menu Gnocci" J


main Menu " Riaza", Pexn', Risa ", (anocd '
TNeo elemen addid_ibneso omay md 6ld elemeB
in t 6d may a mainMenu reiaauna
he LannR
Page No.
Date I
Saath
CnCSpy- spread oeaao

Con _menu LreokauuranstaakaMenL otaumt.ho

Oe_Con Me. Spre ad operatr tu rehun_chanack o

Lons sh Sonas_
Cn letkns L sh's:1
# laes will chnn f , "n'"a"'s', *_","s,"]
Reat ahtean amd Paramtens
eyacky losks ka spre
opRkes bu uak cmpla lelyspposik o i b
hspread aperatr h t mpack on arrny usbile ru
iSt pe elomens Ano an
ReA aten n aid unm osuc huuns
s Labohos:L,2/34,S)
l l he ,2-ond amd
aa d,4S ) as stun)
Csnst Lpizza Sto oMn FndJ: L... epkaanammai
okaLnant Staatkonu
Noo w
pizza risoHo md om amay
em comtai nin oen u
Straka 2 main Mnl a_
otCod
Cont isat,. eekdas
will give a sa dogeek restaurmt.oparing
sod
Hour
Cm kaing ohin da ie Thu akday_dojec
,m.

Page No.
Date
Saatht)

'ntumchos as aameler_

Conct ddd= fumchon (..numers)

add 2,3) ( l l rehun omay


y4L23
addS,,,2) / n Ts,32,21
add&2,S,3,2,14):// *_ Ts2,3z1tl-
Now on addin

fo u i 0i<nunmbers.lepm itt)
SUmtnuners lL)
low wll ehun 2um Owmau e

Co
orderPzui Suncham main ngsidien,oterlogrzáiunk)R.
l l reuun kt a maio ingsudiwt &stseas a
emorasaditnk

osauamt. ode Pizza musbuomonim oit tpinecb


shmmm as main A slheasas amay annsaedius

Spresdcpeat uwtd ohon e e 0 i k calus paLaktd


Lámmas theue reok b_ tdwhon u a Yanalol
cpaaked ly coma

Shst Crau ing-(; 44


nd)
We

Sho cis cuuk evauaton od


OR S shs Cirti hvng. sxkm l chek
A tamhy valu and giviF a u l . uikhout
Condih'ov8
chckinq PageNo.
Date /- Saathi
nab) ill i 3
C"IL (ona wil ona
(uI o ill iv
imdonad 1nulMill hnul
undakingd I| 011/11LHello 11 23 11 nuu)

h_Shast cirruiegAymull chack atny


AND
i wil stop_ ehecoi nd
** team e shole stalement astalnye uslhout WReA

ASonsa Jonas No famy valu

woe OR(1)to set Ashault vnuus


/LR AND to

Nulsh ales cing 9erao


9F mone H
SeLd Csndi hon_ nly ohon Cmdi boa ull
Undaned not r ) ,

oms eskCnotcS
naBaAntnum Guaxls q2 10
9 e 16 buk 4 we dn
resturnt.umuOxES 0 n it l
0

Page No.
Saatht
Date

oaca Asiaaoeat Oeatx -


Logical igoment Opeiatad

ort wed to min YalR t o a opealy epending


Lemdhhom of perataN

Conct resH i
hame Capai,
humGuess 20

Cona e s t 2 i
hamaLo Piarza
unA Cioranni Possi l

SLnun GuetsE eitlnumGuoos \{fo esth. numlaueshs 1=o


ot2 hum Guek= not2numGusk I\Lo/est2numGuLKE |2o
nan ap num Guxts: 20
nam La:Piaz2a'psnRa lovanni Pocsi num huexk , lo
necd caDA OR pshyadds A numGns pupyto
N t 2 ah1ec
u ue Ser nunquK w i l itwill givlo ince
O a aa taly v ko w ill w Oullish val
test num (quLxs 72
Neo t uil ehan num(uAs

ost.Oner 44 AnNoNY MOUS >2


hur2.Dsnn '<AnNoNYMOUC
amA 'Capij num auss 0f
A nam La lcz1a,ooneA <ANONYMUS 2', numGnmshi lof:|
a c k u nsung a os
hon id b
Page No.
rehm) sumd v lu.
Date
Saathi
he for-o laop
The a o Stalement ceaki a U.
ikrahr A krablu obuck includtng bult o
ay,aay ike ecs Tyetdhreny Map se md_tae
dered a olo._2 invake3 C_catn itexabs60 hook ait
alemenks to be execukto for th alue eeach dixhinc
pAONeAya bc
kynkax
Yyuialat)ao rall)i
StatemenE 0peck Khoseikes
ropeshca eHrates.
9On_each iderabon a mlu
oa dtterent propery is
asigmed to muialde May be
deelaoduih const, le a

oeonsscalucalus b ikas i
takmm
S

ne
Conhnue and preak 8ademau in it
UGR COm we arras csae uing int it
Consr menu2 L raimt StaaEAMonu4 ekaiinamb
menu
e CConst ilem ofnmenu_.
ConsDle.La ilem)
elemank A
twe indu elomon bsth hni use ue
oCons ilem of Manu,enteUO)S
Conk.s $tikn Eo al: ikmLo?);
Page No.
Saath
Date/-/-

/Hee menuenems_wll baicay


em inder o elomint
Co R Cm destonh h em_ino
i n a Sma oay
oz (Cma Lidjo menu.encaie)
CisnyslaLog ('Sia1}: } ) ;

Ebamed c trau
opénAk hour Dbzoe
n reotaumant e c :bub _wth enlemceddec tiltal
Coro dleina Mobc euhhde omd nt eka o
ar

Cons oNeningheurT_
Ou3
pen: 12
closei 22, Obc creakd eukieda
otauam hd

open: 1L-
cle:23

Sat:
Open: O

Cose, 24,

ConE resttuu rom ohgse crtektd oufh


nam
reemi C etauusami
Page
openinghouS,
Date Saathi
we e alno wle ackom_ a dikkaent way
Eaalen e e d to mk
oroles fnckin Slante ndax , oin ndex )
ha>

.
No e Can hkk
orden saupnndox, maun mdex)

Anyhang Loten o sauane banck.et cam be_compukd


wenaeke a m a y ckweck da
Lors eakdans - L'mon,'tue",wed', Hu 3at'suJ
No Cncpenia hosepeck
Lons cpening Hau . L

Epn:12
elae 2

Lweekdass[41]: f

chse : 23

Lday$£2t4} J:f here i i ive


oay- C52 hatur
clsse w ih S4uAre backe
T ill tormpuk ib

Page No.
Saath
Date /-1-

Qphionachaining -12.)
he ophnal_chaimirg perahr \
enalsle o cead valuo DAONAhy ocaud deap-
uahhin a chain 0 ConnetRd doid ulhau haig b
chack Ha each rekerence in H clain i ald.
Th _perakor i ke he (L
chaini penatur, excapt &ak intead oco cauwing m

enr a heeren.co i nullish nul pr ndoknod,


expeim shnt-cicub. usiha a etun ueaua _o mdakina
Ohea neel uih a mcinocall,ih rekum mdelined
i ha onploac hiom docanE ext.

*|Opkmal chainig Canno be uned on a non-deelausd ot


gec but can be ned uimam ndesinod voo cbjcek-
rekaant openingkos . mon20pn

Optrzku chenks Lahehhea


n exlk in penirg.hams.

me dhadk mdsirs
Ca restaumat.odenl2lo,1)17 Mehod daco nst 'exlg)
V hek it ill ehick usheha h mekad
odn ex nak_Hn it wil gi
ndoaed ullih dpnaky ill man
nex shakmor

he on o n checkiom may b
E nKE uses I iamiJanes', emaili' htlle @fanas.ia
userso1 9. nak 9 User_anay empy)

PageNo.
Date
Saathi
LaophngDgecds=

larech eusl Ihe abeek kes)mchodehans_on ar


O a ren obees oLan emumeraklL opANy name
He ret ed in he ama eNdon ho= a ntsmal ADOp0
e Cm da eckes LopeninAHous)
ll e_ amay fn 'se

ot a gren ahzect'ssoan enumeraol peAhy valus,


H Same Ordea the a nomm uop woudd
z Cons aue)
abzeek.values lopenirgttoung)
h e e he yaluy wil1 give COeundrg
valu as gec

Ogcch.enkaica ) h oecken
entnesC) Meturd tham
aa oa hen ogcs oon enuroerable shino
oeahy ovaue pal
Cms enteaics.Eobzactensiss f openingtteus)
8 he Hhrnrodll 9ine m aoy d3 n
pais LAray C2) Any(2)Aray (2)1.

w Cm alA0 Lyop eA_ennek Cmd also n .

taCons ey, epen, dose enties)


Cge desbicwan va
desgahunr och ay o enn

Page No.
Seks
The
sek dozee stot miqueyalla omy date
ypeohehaa mimiiyevalu dhgec reereno
o

Congcders Set n u s SetL *Pasklzna, Pina, RisoH6

ane vniqu
9 wilN onlyyrehun 3value Coz ny
P Piza, Rispto
Mehodso Se
addl)- addo a unsqua elemen i n e .
doloke O 9deloko unisu elomons fom se
ha _checs ohathen am elemon is prhenE in So.
eloaa ) 9 cleau ha se tonb elameuk,

*WeanhorakesOur an element fam Ser sin


has misu a in modADd_mahnwA We_oan

lkrae eA

Naps
he Map obpeed hslds yvalu pairrOnd rtmembes
nàghnal in.ceuBo xdeA o H
operamd pmuhre valu8O) may be old a eather a
a alue

ohze ke_a aluway Sting /syanbshs but in


a Can be nyhni ojeck ch n ohesnmap. et._
Syrta
Const rest Des Map )
eot sehnami'clasito 2kalianb)
st.ser(1,Krcne [nly)
we us dick rest wopped toz
Map,
PageNo.
Date I- Saathi
e mehod Can be uned emayR VeluA
Set Caksme Lalha, Pizzeria, Vegekyian, Oraic

has) chock a value by KeLS-


delae)7 Ja alete_a a u by peAn
cleas) e cloo

as ke
hest set(L,21,'Ter);_
me es.geC,21)),w wm 22 les a
ale hecaMe 2 in sek ad Cii1 g t
boh dilReren ea in heag mcerunW, o o mak ik_
LAD wR hane o dahns i 2aslia S ha y M1
e mo
tsn arY L2
et.se(a Tex)

DOM ee meat es keu ld


em OM

UWe canuo AMaya auay idea Map


Lons quLohom *: ne Map(L

L2,Jova
L3,JaveSei,
Cvst 3,
ue CovoreJ
LfaheTyAgaina
Page No.
Date. Saath

9 s Similas to olyclh enlesoeringla)


Oca enkiesloperina that ue
iot a map
Con hourc Map2no
Mapolzdentait3 openigtauL
Mtohoos
Cnvet ma_to
Spreadoperal ) wing

.queahom) 1 wll chm m_aMOY


ke L a
lAhen uae ohich Daa Shouucture'
Array VSes

roy
Use ohon dere d i Seb
Use_ hen neodod Ao
aue(mhrin &duplüca)
eeded
se shen needud Ao Use emave duplicaka
meppulale_ daBa. in caoe highperornenca
Obrpcks Maps

Obyechs Mas
Ms tadi homal key /veu Bcttec Peamonce
Stme labutd byeck)
have y dak Aype
aner to Lanke md accon Eosy to ikrae
yo Compu Si
Ue ohonuwchon induded Use hen simply eed to meP
Use when wulcnq uih key fo yauen
JSON Cn onneat s ap Use wshon
PageNo.
Saath
Date.

Strong represNE_ahd
he shing algek ic uoed o
maniptlak a o chonacteas

aoranoca yreae 1
exncE
dexe
a pA
ar Lat Indiy and menipulak it ik
Const alrline ' TAR Aic fashugal
alline T'ol'T
Muluody
aurlint.lengh 1.
rine.1ndexor') 6
ouine Laolindeo r ) Jd
a l i n e IndxD£( Vahpal 8

Sis9 ill accspt a shaubrg_indix md. Rnd indez


gr e Subshing ehreen indeAS excludiny_e
endindex isnotspiked Hen ih will g
aubshm hl Lat
Ea aring. sic(4) A Patugal
casUns slice 4,7 Hx
Length o subshing 1nd- Sta)
e cam une d d & lthdd n Siceto speci
oh ig_o chanocka loon suething
9 we dokina naahe Indox hen gs
Counhing Am end f£ u put 2ahre_a
end indax hem i t will Counk nend to ap
Eg aiire. sicet,-)> AP Air Pachuga

sirg to lowerCane o make Shng oweA(gK


sBir teppeACane » mak shira upper Case
Sto eim fo' kmore hank spar
Page No.
Date Saath

C Cm M
a

Shonolasta Cax ), himt) r l l CmMa o a


CU

repl2- wilreplarze y_chanka nd


en
Shir
chanec kia_ Starq acLepk
ez vaue toreplace.
Con reEUR 288,9
Cons ice pice EURieplee )cplace (
lo pricU 288.39
9 llteplace t oceunmca c chanka r sh
remov ad hav s malte i abal..
ConAtannouncaYment : A ome dor 23. A daty 23
announcomentrcplace nor gak 2 9E _nal ine
ome aak 23 A dar 23

hhd
AU Coma o ak 23. ak 23'

Jacluduoll, slasktith(),endsain) illhuan e


boslean
tonsk plane Airbio A320 neo
plane indudin A326')2aue
planenodudip Beeing ab
lm.slnkwih C ir? h u .

Page No.
Date /
Saath
SptiY, 9dd2 the hing ino m osdoned s
RLbsmrspus Aess Subships nho m a nd
rewnsth aay, Th diisian U dona by eaneki..
inj
CpaHean ohou Da Hea y piovded aj
A pmamaka in nmeods call
COn Sh a tveMya nic t Stn4
Shs.spit+')_ 9 l a , loa,'vey,'nia' Stini

in {w 1io) mehod creat cmd ehuws


by concaknahrs- a l o t H olemsnk in on auay,

Bepaaakd D- Comma Y a Speciho Sepcna tuY n9

ea Congs LstNans shlama onal Schmedmann .Spl


_CNSned Name Mz tama lashhame UpparCanDI.li T

neLOMAne Msona SHEMEDTMANN

Lfumchon to caplalizaKan

tons Capi-alizzAlame unchn(nama)


conkt namen nama, splil-{" ")2
Lmst namtstlpptrEU
luSnst n onameA)
namenLppAspuph n.reploce ln[o, n [o). lo Upperlonc)))

a onam apit.lizd.

Padding Stol
e tuwo me hnnds siou
nd end paAd padStakt) 2_padEndl)
Bsth l c e p Aue pcsamekns aK lengm zecel
PageNo.
Date Saath)

aha
oddg pa 9 n _ a d a a i _ l l add

ldo eeo
HIL lap taam eghnne in padi
ona ad Shent (20,), pad
Endleot)
20 30

fumchon moak h Cond


Cons mmk Cand uncion (num be
ConsE Sh numbert-
Con as shr slica 4
ehwnlaor padSlauk ( chslength, ) _
rook Cand 878 3S421316 2o43)
l l rthum

Page No.

You might also like