NIIT练习.docx

上传人:b****7 文档编号:8787587 上传时间:2023-02-01 格式:DOCX 页数:16 大小:23.20KB
下载 相关 举报
NIIT练习.docx_第1页
第1页 / 共16页
NIIT练习.docx_第2页
第2页 / 共16页
NIIT练习.docx_第3页
第3页 / 共16页
NIIT练习.docx_第4页
第4页 / 共16页
NIIT练习.docx_第5页
第5页 / 共16页
点击查看更多>>
下载资源
资源描述

NIIT练习.docx

《NIIT练习.docx》由会员分享,可在线阅读,更多相关《NIIT练习.docx(16页珍藏版)》请在冰豆网上搜索。

NIIT练习.docx

NIIT练习

1.Whichofthefollowingisnotanapplication(应用程序)software?

________

A)MSVisualStudioB)LinuxC)PhotoShopD)MSOffice

2.Whichofthefollowingisaninputdevice(输入设备)?

______

A)PrinterB)MicrophoneC)SpeakerD)VDU(图像显示部件

3.Whichmouseissensitivetopressureandmotion?

_____

A)WirelessB)LightPenMouseC)TouchPadMouseD)TrackballMouse

4.WhichofthefollowingWebBrowerrequiredverylittleharddiskspace?

A)InternetExplorerB)NetscapeNavigatorC)OperaD)Mozilla

5.Whichisadifferencebetweenanalgorithm(算法)andaflowchart(流程图)?

_____

A)Aflowchartisapartofanalgorithm

B)Bothcannotbecompared

C)Algorithmisthegraphicalrepresentationofaflowchart

D)Flowchartisagraphicalrepresentation(图形化表示形式)ofaprogram

6.Convert(转换)isa?

A)NamespaceB)ClassC)Function(函数)D)Escape(逸出)sequence(数组)character

7.Inthestatement(语句),usingSystem,Systemisa?

A)Namespace(命名空间)B)ClassC)ObjectD)Keyword

8.ifanarrayisdeclaredas,int[]arr=newint[5],thetotalnumberofelementsinthearrayis?

A)5B)2C)1D)0

9.whichofthefollowingisanexampleoffunctionoverloading?

A)voidfun()charfun()

B)voidfun()voidfun1()

C)voidfun(int)voidfun(char)

D)voidfun1(int,int)voidfun2(char,char)

10.whichofthefollowingistrueaboutabstract(抽象)classes?

A)Anabstractclassdefinespropertiescommontotheclassesderivedfromit

B)Anabstractclasscanbedeclaredasfinal

C)Abstractclassescannotbeextended

D)Classesdeclaredusingtheabstractkeywordcanbeinstantiated

11.IdentifytheSQLstatement,whichwillretrieve(使恢复)alistofEmployeesfrom

thetableEmployeeswiththecolumnheadingforemp_idasEmployeeIdentityNumber.

A)SELECTDISTINCTemp_id(EmployeeIdentityNumber)fromEmployees

B)SELECTemp_idLIKEEmployeeIdentityNumberfromEmployees

C)SELECTemp_idAS[EmployeeIdentityNumber]fromEmployees

D)SELECTemp_id=EmployeeIdentityNumberfromEmployees

12.WhichofthefollowingpropertiesdoesatransactionNOTposses?

A)AtomicityB)Consistency

C)IsolationD)Separation

13.Whichdatabase(数据库)objectwillyoucreatetoenforce(实施)businessrule?

A)StoredProcedures(存储程序)B)Views(视图)

C)TriggersD)Indexes(索引)

14.Whichdatefunctionwouldyouusetoextract(引出)aspecified(指定的)part,suchasday,month,oryearfromthespecifieddate?

A)DATEPARTB)DATEADD

C)DATEDIFFD)DATENAME

15.Inwhichsituationyoumustcreateaclusteredindex?

A)Databaseusesdecisionsupportsystem

B)Columnstoressequentialdata

C)Querycoversallthecolumnsinatable

D)QuerycontainsaWHEREclause

16.WhichofthefollowingisnotaDBMS?

_____

A)OracleB)LinuxC)MicrosoftSQLServerD)Sybase

17.”ColumnPriceshouldbegreaterthan$1000andlowerthan$2000”.Thiskindofconstraintbelongsto_________functionofDBMS.

A)restoreB)synchronousC)securityD)integrityconstraint

18.WhatistherightresultafterexecutionofSQLstatements“Selectdateadd(dd,12,'2010-12-10')”?

____

A)2010-12-22B)2011-12-10C)2022-12-12D)2011-6-10

19.WhichofthefollowingSQLstatementscanbeusedtocreatenewdatabaseobjects?

____

A)DDLB)DMLC)DCLD)DQL

20.Whichofthefollowingoperatorsisusedtodisplayasetofrecords(记录)thatcontainvalueswithinarangeinacolumn(列)?

______

A)ORB)>=C)BETWEEN..ANDD)%

21.Whichofthefollowingwildcard(字符)representsasinglecharacter?

_____

A)%B)_C)[]D)[^]

22.Whichofthefollowingisnotavalidtypeoftrigger?

______

A)InsertTriggerB)UpdateTrigger

C)DeleteTriggerD)BeforeTrigger

23.The?

complierisusedforC#

A)ccB)cscC)c++D)csn

24.intNumber1=0;

intNumber2=0;

int[]Array1=newint[]{2,3,4,5,6,7,8,9,10,11};

foreach(intCtrinArray1)

{if(Ctr%2==1)

Number1++;

else

{Number2++;

Console.Write(Ctr);}

}

Whatistheoutputofthecode?

A)357911B)246810C)CtrD)234567891011

25.Whichofthefollowinglocksenableotherstoviewthedatabeingmodified(修改的)bythecurrenttransaction?

A)sharedlockB)exclusivelockC)updatelockD)intentlock

26.WhichofthefollowingcomponentsofSQLServer2005isusedtocopyanddistribute(区分)dataanddatabaseobjectsfromonedatabaseservertoanother?

A)ReplicationB)Servicebroker

C)Full-textsearchD)Notificationservices

 

二、阅读程序写结果(每小题5分,共10分)

1.

usingSystem;

usingSystem.Collections.Generic;

usingSystem.Text;

namespaceMultiArray

{

classMultiArryExample

{staticvoidMain(string[]args)

{intn=0;

intsum=0;

introwsum;

int[,]mArray=newint[2,4]{{1,2,3,4},{5,6,7,8}};

for(introw=0;row<2;row++)

{rowsum=0;

for(intcol=0;col<4;col++)

{if(mArray[row,col]>0)n++;

Console.Write("{0}\t",mArray[row,col]);

rowsum=rowsum+mArray[row,col];

}

sum=sum+rowsum;

Console.Write("={0}",rowsum);

Console.WriteLine();

}

Console.WriteLine("n={0}",n);

Console.WriteLine("sum={0}",sum);

Console.ReadLine();

}

}

}

2.

usingSystem;

publicclassA

{

publicvirtualvoidFun1(inti)

{

Console.WriteLine(i);

}

publicvoidFun2(Aa)

{

a.Fun1

(1);

Fun1(5);

}

}

publicclassB:

A

{

publicoverridevoidFun1(inti)

{

base.Fun1(i+1);

}

publicstaticvoidMain()

{

Bb=newB();

Aa=newA();

a.Fun2(b);

b.Fun2(a);

Console.ReadLine();

}}

//b.Fun1

(1);2

//Fun1(5);5

//a.Fun1

(1)1

//Fun1(5)->base.Fun1(5+1)6

三、程序填空(每空2分,共10分)

/*ThefunctionoffollowingprogramisthatCalculatethefactorialofthenumberenteredbyauser.(Thelimitofusersinputshouldbe1-20)*/

usingSystem;

classFactorial

{

staticlongFac1;

publicstaticboolFac(longn,outlonganswer)

{

longk;

boolok=true;

if()//userinputshouldbe1-20

{ok=false;}

else

{

;

for(k=2;k<=n;++k)

{

;

}

}

;

returnok;

}

}

classFactorial1

{

staticvoidMain(string[]args)

{longFac1;

boolok;

longNumber;

Console.WriteLine("EntertheNumberforcalculatingfactorial(1-20):

");

Number=long.Parse(Console.ReadLine());

ok=;//functioncall

if(ok)

Console.WriteLine("Factorial("+Number+")="+Fac1);

else

Console.WriteLine("Incorrectvalue");

Console.ReadLine();

}

}

2.

/*Thefunctionoffollowingprogramisthatcheckapalindrome(回文)characterarray*/

usingSystem;

namespaceManipulateArray

{

classpalindrome

{

staticvoidMain(string[]args)

{

char[]str=newchar[10];

Console.WriteLine(“EnteraPalindromestring(Max10char):

”);

;

//CallingtheCheckPalidromemethod

Console.WriteLine(CheckPalindrome(str));

Console.ReadLine();

}

privatestaticboolCheckPalindrome(char[]myString)

{

intstartChar;

intlastChar;

;

;

while(startChar

{

if(myString[startChar]==myString[lastChar])

{

;

;

}

else

{

returnfalse;

}

}

returntrue;

}

}

}

四、画流程图(6分)

Drawaflowcharttoacceptthreenumbersanddisplaythelargestnumber.

Drawaflowcharttodisplaytheaverageoffirsttenoddnumbers.

五、编程题(14分)

Pleasedevelopaprogramusingtheabstractclasses,YouhastoCreateaDraw()functionintheprogram,todisplaythefollowingstatements.

It’saPoint.

It’saLine.

It’saCircle.

usingSystem;

namespaceDrawShapes

{

publicabstractclassDrawingObject

{

publicabstractvoidDraw();

}

publicclassLine:

DrawingObject

{

publicoverridevoidDraw()

{

Console.WriteLine("It’saLine.");

}

}

publicclassCircle:

DrawingObject

{

publicoverridevoidDraw()

{

Console.WriteLine("It’saCircle.");

}

}

publicclassSquare:

DrawingObject

{

publicoverridevoidDraw()

{

Console.WriteLine("It’saSquare.");

}

}

publicclassDrawDemo

{

publicstaticintMain(string[]args)

{

DrawingObject[]dObj=newDrawingObject[3];

dObj[0]=newLine();

dObj[1]=newCircle();

dObj[2]=newSquare();

foreach(DrawingObjectdrawObjindObj)

{

drawObj.Draw();

}

Console.ReadLine();

return0;

}

}

}

2.

PhilipAndersonisasoftwaredeveloperwhoworksforMegaTechnologies.Heiscurrentlyundertheprojectofgeometriccalculations.Philiphastodevelopaprogram,whichperformsthefollowingtasks:

1.Calculatetheareaofcircle.

2.Calculatethevolumeofthecube

Hehastodevelopthecodeusinganinterface.

usingSystem;

namespaceCalculateArea

{

interfaceArea

{

voidcalcArea(doubleRadius);

}

interfacevolume

{

voidcalc1(intSide);

}

publicclassCircleCube:

Area

{

publicvoidcalcArea(doubleRadius)

{

doublePie=3.14;

doubleResult;

Result=Pie*Radius*Radius;

Console.WriteLine("TheAreaofacircleis:

{0}",Result);

}

publicvoidcalcVolume(intSide)

{

intResult;

Result=Side*Side*Side;

Console.WriteLine("TheVolumeofacubeis:

{0}",Result);

}

}

classclass1

{

publicstaticvoidMain(string[]args)

{

CircleCubeobj=newCircleCube();

doubleRadius;

intSide;

Console.WriteLine("Entertheradiusofthecircle");

Radius=Convert.ToDouble(Console.ReadLine());

obj.calcArea(Radius);

Console.WriteLine("Enterthesideofthecube");

Side=Convert.ToInt32(Console.ReadLine());

obj.calcVolume(Side);

Console.ReadLine();

}

}

}

六、E/R图绘制及与关系模式的转换(10分)

Acompanyhasanumberofemployees.TheattributesofEmployeeincludeemployeeID,name,address,andbirthdate.Thecompanyalsohasseveralprojects.AttributesofProjectincludeprojectNameandstartDate.Eachemployeemaybeassignedtooneormoreprojects,ormaynotbeassignedtoaproject.Aprojectmayhaveanynumberofemployeesassigned.Anemployee’sbillingratemayvarybyproject,andthecompanywishestorecordtheapplicablebillingrate(Billing_Rate)foreachemployeewhen

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 初中教育

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1