You are on page 1of 8

Pi

rMehrAl
iShah
Ar
idAgr
icul
tur
eUni
ver
sit
y,Rawal
pindi
Of
fi
ceoft
hecont
rol
l
erofExami
nat
ions
Fi
nalExam /Spr
ing2020(
PaperDur
ati
on48hour
s)
Tobef
il
ledbyTeacher

Cour
seNo.
: CS-
692 Cour
seTi
tl
e: Vi
sual
Pr
ogr
ammi
ng .
Tot
alMar
ks: 100 (
20) Dat
eofExam: 3rdAugust
2020 .
Degr
ee: BSCS/BSI
T Semest
er: 6t
h Sect
ion A,
B,
C .
Conv
ert
ed
Mar ks Marks
1 11 12 Obt
ained/
Q.
No. 1 2 3 4 5 6 7 8 9
0 Obt
ained/
Tot
alMar
ks
Tot
alMar
ks

Mar
ks /
100 /
20

Obt
ained

Tot
alConv
ert
edMar
ksi
nWor
ds:

Nameoft
het
eacher
: MrI
kram Af
zal&MrShahi
dJami
l

Whot
aughtt
hecour
se:Si
gnat
ureoft
eacher/Exami
ner
:

Tobef
il
ledbySt
udent

RegNo.
:….
.…-
ari
d-….
.…Name:
…………………………………….
…………………….
.Semest
er:
…….
……Sect
ion:
…..
..

Not
es:
1.Byfill
ingouty ournameandr egistrati
onnumberabov e, youPledgethat:“ I
aff
ir
mt hatIhav enotgivenorr eceivedanyunaut horizedhel pont hisFinal
Exam, andthatt hi
swor kismyown. ”
2.Anyst udentfoundbr eachingthe“ Regulat
ionsRel at
ingt otheExami nati
ons
ofPMAS- Ari
dAgr i
cultur
eUni versi
ty ,
Rawal pi
ndi”
,willfacesev er epenalties.
3.Anyf orm ofCheating,Unauthor i
zedHel p,and/orPlagi ari
sm foundi nthe
Answer sgivenbelowwi l
lhavesev erepenal t
yforthest udent,
r angi
ngf rom
cancellat
ionofpapert osuspensi onf rom theUniversityrollsf
orupt o2
years.

Answert
hef
oll
owi
ngquest
ions.

Q.
No.
1. (
Mar
ks10)
Wr
it
eaC#Consol
eAppl
i
cat
ionf
ort
hef
oll
owi
ngscenar
io:

Af amousschoolhast hr
eebr anches(namedA,BandC)i nRawalpindi.School
adverti
sesresul
toftheirA+andAgr adestudent
sthatincreasesit
sgoodwi lland
i
ncreasesnumberofadmi ssi
oninschool.Youarer equi
redt ost
oreresultofeach
studentinarray
.Resultisauserdef inety
pe( Cl
ass)containsrol
lnumber ,name,
mar ks,gr
adeasdatamember s.

Asktotalnumberofstudentsappearedinexam from branchAmakearr


ayoft ype
Resul
tandi nputeachstudentdatainarr
ay.Inputnumberofstudent
sappearedin
exam fr
om branchBmakear r
ayoft y
peResultandst or
edatai
nitandatlasti
nput
tot
alnumberofstudentsappearedinexam f
rom branchCmakear r
ayoft
ypeResult
andstoredataini
t.

Afterdatainallthearr
aysisenteredmakefourtharrayoftyperesultthatst
ores
resul
tofonlyA+andAgr adest
udentsf
rom al
lthebranches.Thendispl
ayA+andA
gradestudent
s’infor
mati
oninsort
edorderofmarks(descendi
ng).

Answer
:

Q.
No.
2. (
Mar
ks10)
Wr
it
eaC#Consol
eAppl
i
cat
ionf
ort
hef
oll
owi
ngscenar
io:

Youar esupposedto stor


edataofcount ri
esinal ist.Count
rycont ns name,
ai
nati
onall
anguage,
populati
on,
andcontinentandl
it
eracyr at
easproper
ti
es.Youar
e
supposedtoi
mplementfoll
owi
ngfunct
ioninyourmainclass.

 v
oidAddNewCount
ry(
List
<Count
ry>cdet
il
)thi
sfunct
ionaddsanewcount
ryi
n
t
heli
stpr
ovi
dedasargument.
 Countr
y SearchCountr
yByName(Li
st<Countr
y> cdet
ail
,str
ing cname)fir
st
argumentoffuncti
onislistofCountr
yandsecondar gumentisthecount
ry
namet osear
chi fcountr
yfoundthanretur
nt heobj
ectofCountr
yandifnot
foundthanr
eturnnull
.
 List
<Count r
y> GetCount
ryLi
tRate(
List
<country> cdet
ail
,f l
oat l
i
trat
e) t
his
functi
onr ecei
vesli
stofcountr
iesandl i
teracyrat
easar gumentandret
urns
l
istoft hosecountri
eswhosel i
teracyrateislessthanorequaltotherate
provi
dedi nargument.
I
nmai
ncal
lal
lthesef
unct
ionsusi
ngmenu.

Answer
:

Q.
No.
3. (
Mar
ks10)
Wr
it
eaC#Wi
ndowFor
m Appl
i
cat
ionf
ort
hef
oll
owi
ngscenar
io:

Save&NextBut t
onwillstor
edat
aaccordingtot heSessionandGenderforever
yst udent
,
whichi
sselect
edbyuser .Makesurepr
eviouslycli
ckeddataalsopreser
ved,sothatwhen
Summar yButt
oniscl
ickedthenyouhavetoshowv aluesfort
helabelsmarkedwith‘????’.
i
.e.Tot
alMaleinMorningaswellasinEvening,andsimilar
lyt
otalFemal
einMor ningaswell
asi
nEv
eni
ng.

[
Not
e:Dat
abasei
snoti
nvol
vedher
e,al
lyouhavet
odoi
satr
unt
ime]

Answer
:
Q.
No.
4. (
Mar
ks10)
Wr
it
eaC#Wi
ndowFor
m Appl
i
cat
ionf
ort
hef
oll
owi
ngscenar
io:

Sum Butt
onwi l
lcalcul
atesum ofall
number
sfrom star
tpoi
ntt
oendpoi
ntenter
edbyuser
i
nt het
wot ex
tbox es,dependi
ngupontheAct
ionselect
edfr
om r
adi
obut
tons.Resul
twi
l
lbe
shownonlabelmar kedas‘???? ’
.

ProductBut
tonwillcal
cul
ateProductofal
lnumbersf
rom st
artpointtoendpointent
eredby
userintwot
extboxes,dependi
ngupont heAct
ionsel
ect
edfrom radiobutt
ons.Resul
twil
l
beshownonl abel
mar kedas‘???? ’
.

Answer
:

Q.
No.
5. (
Mar
ks10)
Wr
it
eaC#Wi
ndowFor
m Appl
i
cat
ionf
ort
hef
oll
owi
ngscenar
io:
GUIgi venabov eisf orcricketteam select
ion.Youar epr ovidedwi thnamesofdi ff
erent
playersinl
st bxsquad( l
abeledasSquadaLi stboxonl ef
tside) .Youhav et owr i
tecodef or
btnselect(
but t
onlabeledasSel ect)andbtndrop(but
tonlabeledasDr op).Onbt nsel
ectclick
remov eselecteditem from lst
bxsquadandmov eittolstbxplay i
ng( Li
stboxonr i
ghtside,
l
abel edasPl ayi
ngEleven)andonbt ndropcli
ckremov eselecteditem from lstbxpl
ayingand
mov ethatitem tolst
bxsquad.Not ethatlst
bxplayi
ngcancont ainsel evenplayersonly.

Answer
:
Q.
No.
6. (
Mar
ks10)
Wr
it
eaC#Wi
ndowFor
m Appl
i
cat
ionf
ort
hef
oll
owi
ngscenar
io:

Val
i
dat
etextboxesi
ngi
venf
orm usi
ngr
egul
arexpr
essi
ons.

 Nameshoul dstar
twithuppercasel ett
erandcont ainsonlyalphabets.
 NI C numbercontai
nsf i
rstfive di git
st han a – f ol
lowed bysev en di
git
s
fol
lowedby–andonedigit.12345- 1234567- 1
 Mobi lenumbershould have11 di gi
ts,star
ti
ng wi th 03 aft
ert hatadi git
between0and4,nextei
ghtsy mbol sshoul dbedigits.
Wri
tecodef orval
i
dat
ebut t
onifallfieldsar ev al
iddi aymessage“
spl OK” .Ifanyof
t
heabov efi
eldi
snotf
oll
owingformat ,displaymessage“ invali
d”.

Answer
:

Q.
No.
7. (
Mar
ks10)
Wr
it
eaC#Wi
ndowFor
m Appl
i
cat
ionf
ort
hef
oll
owi
ngscenar
io:

OnFor
ml oadDat
aGr
idVi
ewi
spopul
atedf
rom dat
abaset
abl
enamed‘
Cour
se(
Id,
Tit
le,
Cr
edi
tHr)
’.
OnSav
ebut
tonst
udenti
nfowi
l
lbesav
edi
ntot
abl
enamed‘
Student
(Si
d,Name,
RegNo)
’,and
sel
ect
edcour
seagai
nstst
udentwi
l
lbesav
edi
ntot
abl
enamed

Student
Cour
se(
Sid,
Cour
seTi
tl
e,
Credi
tHour
)’
.Cl
osewi
l
lcl
oset
heent
ir
efor
m.

Answer
:
Q.
No.
8. (
Mar
ks10)
Wr
it
eaC#Wi
ndowFor
m Appl
i
cat
ionf
ort
hef
oll
owi
ngscenar
io:

Youar esupposedtowri
tecodeforbt
npar
kinandbtnpar
kout
.Whenbtnpar
kinis
cli
ckeddataisstor
edi
nthefienamepar
l ki
n.t
xt,t
hisf
il
econt
ainsdat
ainf
oll
owing
formatgi
vebelow.

RegNumber
#Dat
e#Ti
meI
n;RegNumber#Dat
e#Ti
meI
n;andsoon

Whil
einsert
ingdataint
oparkin.
txtf
il
eifregi
str
ati
onnumberofcari
sal
readyi
nthe
f
il
ethandisplaymessagecaralr
eadyparkedi
n.

Whenbt
npar
kouti
scl
i
ckedmat
cht
her
egi
str
ati
onnumberofcari
npar
kin.
txtf
il
eifi
t
i
smatchedthanremoveRegNumberofthatcarf
rom par
kin.
txtandst
orei
nanot
her
f
il
eparkout
.t
xt.par
kout
.t
xthasdat
aasfol
lowingf
ormat.

RegNumber
#Date#TimeIn#TimeOut
#Hour
s#Amount
;RegNumber
#Dat
e#Ti
me
I
n#Ti
meOut#Hours#Amount;
andsoon

Al
sodi
spl
ayHour
sandAmounti
nrel
evantt
extboxes.Char
gePKR10f
orperhour
.

Answer
:

Q.
No.
9. (
Mar
ks10)
Wr
it
eaC#Wi
ndowFor
m Appl
i
cat
ionf
ort
hef
oll
owi
ngscenar
io:

Consi
dert
abl
eschemagi
venbel
ow

LoginDetailt
ablecanhavemanyr ecordsbutATMCasht abl
ehasj ustoner ow.Data
i
nATMCasht abl
erepresentnumberofcur r
encynotesof5000,1000and500.
Whenev eramounti swi t
hdrawnt hisdataisupdated.Whenaper sonwi shesto
withdrawanamountf i
rst5000not eswil
lbewithdr
awnthan1000andatl ast500for
exampl eifamounttobewi t
hdrawni s6500thanonecur r
encynot eof5000,one
currencynoteof1000andatl astonecurrencynoteof500wi l
lbewi thdrawnand
dataintheATMCashwi l
lbeupdate.

Consi
derf
oll
owi
ngf
ormsgi
venbel
ow.
Logi
nFor
m

Whenbtnl
ogi
niscl
ickedifaccountnumberandpi
nmat nl
chesi ogi
ndetai
ltabl
ethan
MenuFormisshowifinv
alidlogi
nisenter
edthandi aymessageI
spl nval
idaccount
numberorpi
n.

MeuFor
m

Whenbtnwit
hdraw (
labeledCashWi
thdr
aw)isclickedWi
thdrawFor
mi sshownand
oncl
ickofbtnbal
ance(label
edBal
anceInqui
ry)amountoflogi
naccountnumberi
s
di
spl
ayedinmessagebox.

Wi
thdr
awFor
m:

ckofbt
Oncl
i nwi
thdr
awf
ir
stofal
lcheckf
oll
owi
ng

 Whet
heramountisdiv
isi
bleby500ornoti
famounti
snotdi
vi
sibl
eby500
t
handispl
aymessage“
Inv
ali
damount
”.
 Ifamountisdi
visi
bleby500checkwhetherwi
thdr
awnamounti
sgreatert
han
avail
ableamountinaccountifiti
sgreatert
handispl
aymessage“Amount
greatert
hanavail
abl
eamount”
.
 I
famountislessthanorequalt oavai
l
ableamounti
naccountt
hancheck
whet
herwit
hdrawnamountexceedsav ai
l
abl
eamountinATM ifyesthan
di
spl
aymessage“ATM outofcash”.
 Atl
ast,i
fallokt hanwit
hdraw t
heamountandupdat eATMCasht abl
eand
amountavai
labl
einaccountanddispl
aymessage“
Transact
ionsuccessf
ul”
.

Answer
:

Q.
No.
10. (
Mar
ks10)
Wr
it
eaC#Wi
ndowFor
m Appl
i
cat
ionf
ort
hef
oll
owi
ngscenar
io:

Youhaveapati
entf
il
ethatcont
ainsPati
entID,Name,dat
eofbir
thDOB,Doctorand
Probl
em asf
iel
dswit
hpipesignsepar
ator|andeachpati
entr
ecordi
ssepar
atedbytil
de
si
gn~.

Oncli
ckofBrowseandFi
l
lText
boxbut
tony
ouhav
etor
eaddat
afr
om br
owsedf
il
eand
assi
gntotext
box.

Youalsohavetoimpl
ementDragandDropf unct
ional
i
tyforText
boxsothati
fuserdr
agsa
pat
ientt
extfi
leanddr
opsontext
box,i
twil
lreaddatafrom f
il
eanddi
spl
ayintext
box
aut
omatical
l
y.

Oncli
ckofPar
seandf
il
lDat
agr
idbut
tony
ouhav
etopar
set
het
ext
boxandf
il
lto
dat
aGridVi
ew.

Oncl
i
ckofSav
etoDBf
rom Gr
idy
ouhav
etosav
eal
lrecor
dsi
nPat
ientt
abl
eofy
our
dat
abasewi
thsamecol
umnnameasofGr
id.

Answer
:

You might also like