您好,欢迎访问三七文档
当前位置:首页 > 电子/通信 > 综合/其它 > 《基于web的程序设计》作业参考答案
基于web的程序设计作业参考答案第1页共6页《基于web的程序设计》作业参考答案一填空题1.Variant或变体2.83.Cstr()4.里路5.206.HTMLEncode7、①回车换行②空格8、ahref=test.htm……/a9、CInt10、111、optionexplicit12、-313、用来强制两个表达式做字符串连接,用来连接两个字符串14、修改循环条件15、用来获得客户端信息16、用来控制送出给客户端的信息14、sub没有返回值而function有18、将虚拟路径转化为物理路径19、abandon20、commandtimeout21.Variant或变22.①回车换行②空格23.optionexplicit24.abandon25.2026.HTMLEncode27、variant28、里路29、用来强制两个表达式做字符串连接,用来连接两个字符串30、231、将虚拟路径转化为物理路径二选择题1.B2.B3.C4.A5.B6.B7.B8.A9.B10.C11.D12.D13.A14.C15.B16.A17.C18.B19.B20.D21.A22.C23.D24.A基于web的程序设计作业参考答案第2页共6页25、B26、B27、C28、D29、A30、A31、A32、B33、D34、B35、C36、B37、A三读程题1.(1)rs.AbsolutePosition=(pageno-1)*pagesize+1(2)rs.movenext2.textfile.writeline(欢迎来到计算机世界)3.(1)=year(d)&年&month(d)&月或response.writeyear(d)&年&month(d)&月(2)=day(d)&日或response.writeday(d)&日(3)=hour(t)&时&minute(t)&分或response.writehour(t)&时&minute(t)&分4.(1)=1000*(1+0.015)^i或response.write1000*(1+0.015)^i(2)=1000*(1+0.03)^i或response.write1000*(1+0.03)^i(3)i=i+15.sum=sum*Inext6.(1)insertintostuinfo(学号,姓名,性别,入学时间,年龄)values(’40212001’,’张三’,’男’,#2002-9-1#,18)(2)delete*fromstuinfowhere入学时间=#2002-9-1#and性别=’男’(3)updatestuinfoset年龄=年龄+1(4)selecttop(10)fromstuinfo(5)selectcount(*)fromstuinfogroupby性别7.(1)rs.AbsolutePosition=(pageno-1)*pagesize+1(2)rs.movenext8.(1)=year(d)&年&month(d)&月或response.writeyear(d)&年&month(d)&月(2)=day(d)&日或response.writeday(d)&日(3)=hour(t)&时&minute(t)&分或response.writehour(t)&时&minute(t)&分9.x=0,y=610.1511.(1)selectsum(语文)fromscore(2)selectavg(数学)fromscore(3)select语文+数学+外语+理化,(语文+数学+外语+理化)/4fromscore四编程题1.%row=request(text1)或row=request.form(text1)col=request(text2)%或col=request.form(text2)tableborder=1width=600heigh=200基于web的程序设计作业参考答案第3页共6页%fori=1torow%tr%forj=1tocol%td%=i%%=j%/td或td%=i&j%/td%next%/tr%next%2.%ifday(date)=25thenresponse.write”请注意,明天可能有病毒发作”%3.%setconn=server.createobject(”ADODB.connection”)setrs=server.createobject(”ADODB.recordset”)conn.open”busstop”sql=”select*frombus”rs.opensql,conn,1,3ifnotrs.eofthendimpagenopageno=cint(request(pageno))ifpageno=0thenpageno=1rs.pagesize=10rs.absolutepage=pagenodimII=rs.pagesizedowhilenotrs.eofandI0I=I-1response.writers(线路)&rs(站点)&brrs.movenextloopresponse.write请选择页数:forj=1tors.pagecountifj=pagenothenresponse.writej& elseresponse.writeahref=1.asp?pageno=&j&&j&/a endifnextrs.closesetrs=nothingconn.closesetconn=nothing%4.(1)%setconn=server.createobject(”ADODB.connection”)基于web的程序设计作业参考答案第4页共6页setrs=server.createobject(”ADODB.recordset”)conn.openstu或者conn.openDSN=stusql=select姓名,性别frombussetrs=conn.execute(sql)response.Write姓名性别brwhilenotrs.eof%ifrs(性别)=mthen性别=’男’else性别=’女’endifresponse.Writers(姓名)&&性别&brrs.movenextWendresponse.write总共有&rs.recordcount&个学生Setrs=nothingSetconn=nothing%(2)%setconn=server.createobject(”ADODB.connection”)setrs=server.createobject(”ADODB.recordset”)conn.openstu或者conn.openDSN=stusql=Selectname,Chinese,mathfromStudent,Scorewhere学生学号=学号setrs=conn.execute(sql)%--response.Write姓名语文数学总成绩brwhilenotrs.eofresponse.Writers(姓名)&&rs(语文)&&rs(数学)&&(rs(语文)+rs(数学))&brrs.movenextwendSetrs=nothingSetconn=nothing%5.%dimx,yforx=1to9fory=1toxresponse.Writey&*&x&=&x*y&ifx=ythenresponse.Writebr0Dnextnext%6.%dimx,yforx=1to9fory=1toxresponse.Writey&*&x&=&x*y&-----ifx=ythenresponse.Writebr-----nextnext%基于web的程序设计作业参考答案第5页共6页7.(1)%setconn=server.createobject(”ADODB.connection”)setrs=server.createobject(”ADODB.recordset”)conn.openstu或者conn.openDSN=stu--------------sql=insertintostudent(学号,姓名,性别)values(’40612001’,’陈六’,’M’)-------------setrs=conn.execute(sql)-------------------sql=insertintoscore(学生学号,语文,数学)values(’40612001’,80,60)--------------setrs=conn.execute(sql)-------------------setrs=nothingsetconn=nothing%(2)%setconn=server.createobject(”ADODB.connection”)setrs=server.createobject(”ADODB.recordset”)conn.openstu或者conn.openDSN=stu-------sql=Select姓名,语文,数学fromStudent,Scorewhere学生学号=学号-------setrs=conn.execute(sql)%--------response.Write姓名语文数学总成绩brwhilenotrs.eof----------------response.Writers(姓名)&&rs(语文)&&rs(数学)&&(rs(语文)+rs(数学))&br----------------rs.movenext----------------wendSetrs=nothingSetconn=nothing%8.%row=request(text1)或row=request.form(text1)col=request(text2)%或col=request.form(text2)-----tableborder=1width=600heigh=200%fori=1torow%---------------------------------------------tr%forj=1tocol%-------------------------------------------td%=i%%=j%/td或td%=i&j%/td--------------%next%-----------------------------------------------------/tr%next%---------------------------------------------五简答题1.tablewidth=600height=200border=1align=centertrtdalign=center计算机/tdtd/td/trtrtd/tdtd/td/tr基于web的程序设计作业参考答案第6页共6页/table2.(1)select*fromstuinfowheresubstring(学号,5,2)=’01’(2)select*fromstuinfowhere姓名like’王%’(3)select*fromstuinfowhere年龄between18and20(4)selectcount(*),性别fromstuinfogroupby性别(5)selectcount(*)fromstuinfo(6)selectcount(*),性别fromstuinfo政治面貌=’党员’wheregroupby性别3.(1)selectsum(语文)from表名(2)selectavg(数学)from表名(3)select语文+数学+外语+理化,(语文+数学+外语+理化)/4fr
本文标题:《基于web的程序设计》作业参考答案
链接地址:https://www.777doc.com/doc-2833113 .html