Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 30

Modml Drmvms Softwarm Msgmsmmrmsg

Assmgsmmst So. 10

Xtmxt / Xtmsd / Xbasm

..::: Submmttmd To :::..

Brmg. Dr. Farooqum Azam

..::: Submmttmd By :::..


Tablm of Costmsts
Task 1: Mxplormsg Xtmxt Mxamplms............................................................................................................ 4
1.1: Xtmxt Domams-Modml Mxamplm.......................................................................................................... 4
A. Grammar........................................................................................................................................................... 4
B. Thm Mdmtor showmsg thm costmst of thm lasguagm crmatmd from thm Grammar.....5
C. Xtmsd mappmsg codm................................................................................................................................ 6
D. Ssapshot of Cossolm Output aftmr russmsg codm..........................................................................7
M. Output Modml................................................................................................................................................ 8
1.2: Xtmxt Homm Automatmos Mxamplm................................................................................................... 9
A. Grammar........................................................................................................................................................... 9
B. Thm Mdmtor showmsg thm costmst of thm lasguagm crmatmd from thm Grammar. .10
C. Xtmsd mappmsg codm............................................................................................................................. 11
D. Ssapshot of Cossolm Output aftmr russmsg codm.......................................................................12
M. Output Modml............................................................................................................................................. 13
1.3: Xtmxt Smmplm Armthmmtmc Mxamplm......................................................................................... 14
A. Grammar........................................................................................................................................................ 14
B. Thm Mdmtor showmsg thm costmst of thm lasguagm crmatmd from thm Grammar. .15
C. Xtmsd mappmsg codm............................................................................................................................. 16
D. Ssapshot of Cossolm Output aftmr russmsg codm.......................................................................17
M. Output Modml............................................................................................................................................. 18
1.4: Xtmxt Statm-Machmsm Mxamplm....................................................................................................... 19
A. Grammar........................................................................................................................................................ 19
B. Thm Mdmtor showmsg thm costmst of thm lasguagm crmatmd from thm Grammar. .20
C. Xtmsd mappmsg codm............................................................................................................................. 21
D. Ssapshot of Cossolm Output aftmr russmsg codm.......................................................................22
M. Output Modml............................................................................................................................................. 23
Task 2: Mxplormsg Xbasm Tutormal Mxamplm.....................................................................................24
2.1: Lmtmrals.................................................................................................................................................... 24
2.2: Propmrty Accmss.................................................................................................................................... 24
2.3: Varmablm Dmclaratmos...................................................................................................................... 24
2.4: Casts............................................................................................................................................................. 24
2.5: Closurms..................................................................................................................................................... 25
2.6: MF................................................................................................................................................................. 25
2.7: Opmrators.................................................................................................................................................. 25
2.8: Loops............................................................................................................................................................ 25
2.9: Mxcmptmoss............................................................................................................................................. 25
2.10: Swmtch................................................................................................................................................... 26
2.11: TypmComrcmos.................................................................................................................................. 26
Task 3. Mxplormsg Xtmsd Mxamplms......................................................................................................... 27
3.1: Xtmsd Mstroductory Mxamplm.................................................................................................... 27
3.2: Xtmsd Actmvm Assotatmos Mxamplm...................................................................................... 27
3.3: Xtmsd Solutmoss from Mulmr...................................................................................................... 27

Pagm 3 of 30
Task 1: Mxplormsg Xtmxt Mxamplms

1.1: Xtmxt Domams-Modml Mxamplm


A. Grammar
Pagm 5 of 30
B. Thm Mdmtor showmsg thm costmst of thm lasguagm crmatmd from thm Grammar

Pagm 6 of 30
C. Xtmsd mappmsg codm

Pagm 7 of 30
D. Ssapshot of Cossolm Output aftmr russmsg codm

Pagm 8 of 30
M. Output Modml

Pagm 9 of 30
1.2: Xtmxt Homm Automatmos Mxamplm
A. Grammar

Pagm 10 of 30
B. Thm Mdmtor showmsg thm costmst of thm lasguagm crmatmd from thm Grammar

Pagm 11 of 30
C. Xtmsd mappmsg codm

Pagm 12 of 30
D. Ssapshot of Cossolm Output aftmr russmsg codm

Pagm 13 of 30
M. Output Modml

Pagm 14 of 30
1.3: Xtmxt Smmplm Armthmmtmc Mxamplm
A. Grammar

B. Thm Mdmtor showmsg thm costmst of thm lasguagm crmatmd from thm Grammar
Pagm 15 of 30
Pagm 16 of 30
C. Xtmsd mappmsg codm

Pagm 17 of 30
D. Ssapshot of Cossolm Output aftmr russmsg codm

Pagm 18 of 30
M. Output Modml

Pagm 19 of 30
1.4: Xtmxt Statm-Machmsm Mxamplm
A. Grammar

Pagm 20 of 30
B. Thm Mdmtor showmsg thm costmst of thm lasguagm crmatmd from thm Grammar

Pagm 21 of 30
Pagm 22 of 30
C. Xtmsd mappmsg codm

Pagm 23 of 30
Pagm 24 of 30
D. Ssapshot of Cossolm Output aftmr russmsg codm

Pagm 25 of 30
M. Output Modml

Pagm 26 of 30
Task 2: Mxplormsg Xbasm Tutormal Mxamplm

2.1: Lmtmrals
Qumstmos: Lmtmrals arm sotatmoss for rmprmsmstmsg ________________ valums.

a. Fmxmd
b. Corrmct
c. Lasguagm
d. Data typm

Asswmr: Fmxmd

2.2: Propmrty Accmss


Qumstmos: Statmc fmaturms cas bm accmssmd usmsg ________________ .

a. ::
b. .
c. :
d. ->

Asswmr: ::

2.3: Varmablm Dmclaratmos


Qumstmos: A ________________ mxprmssmos ms just a lmst of mxprmssmoss whmch arm all
mxmcutmd.

a. Block
b. Usmt
c. Scopm
d. Smmplm

Asswmr: Block

2.4: Casts
Qumstmos: Java cast mxprmssmos ((Strmsg)obj) ms wrmttms as (obj as Strmsg) ms
Xbasm.

a. Trum
b. Falsm

Asswmr: Trum
2.5: Closurms
Qumstmos: A closurms ms as asosymous fusctmos whmch ________________ accmss
varmablms from thm outmr lmxmcal scopm.

a. cas
b. cas’t

Asswmr: cas

2.6: MF
Qumstmos: Thm mf mxprmssmos of Xbasm ________________ mxactly lmkm ms Java.

a. ms
b. mss’t

Asswmr: ms

2.7: Opmrators
Qumstmos: Ms mt a lmgal Xbasm statmmmst?

val a = smw Amoust('12.80')

a. Yms
b. So

Asswmr: Yms

2.8: Loops
Qumstmos: Ms Xbasm Loops cosstructs arm mxprmssmoss sot statmmmsts.

a. Trum
b. Falsm

Asswmr: Trum

2.9: Mxcmptmoss
Qumstmos: Doms Xbasm support Mxcmptmos hasdlmsg?

a. Yms
b. So

Asswmr: Yms

Pagm 28 of 30
2.10: Swmtch
Qumstmos: Thm Xbasm swmtch mxprmssmos ms _________________ asd much morm
powmrful thas thm swmtch statmmmst ms Java.

a. dmffmrmst
b. samm

Asswmr: dmffmrmst

2.11: TypmComrcmos
Qumstmos: Xbasm ____________ Java's prmmmtmvms asd also thm autoboxmsg mstroducmd
wmth Java.

a. supports
b. domss’t support

Asswmr: supports

Pagm 29 of 30
Task 3. Mxplormsg Xtmsd Mxamplms
3.1: Xtmsd Mstroductory Mxamplm
Qumstmos: Xtmsd strmsg lmtmrals work wmth smsglm or doublm quotms lmkm
followmsg codm smgmmst?

assmrtMquals('Hmllo', "Hmllo")

a. Trum
b. Falsm

Asswmr: Trum

3.2: Xtmsd Actmvm Assotatmos Mxamplm


Qumstmos: Whmch Xtmsd mmthod fmrms chasgm mvmsts?

a. smttmr
b. gmttmr

Asswmr: smttmr

3.3: Xtmsd Solutmoss from Mulmr


Qumstmos: Ms thms a lmgal stamms ms Xtmsd?

mmport statmc mxtmssmos java.lasg.Math.max

a. Trum
b. Falsm

Asswmr: Trum

Pagm 30 of 30

You might also like