奥鹏易百

 找回密码
 立即注册

扫一扫,访问微社区

QQ登录

只需一步,快速开始

帮助中心知识拓展客服QQ 515224986
查看: 731|回复: 0

北京理工大学2020年5月《脚本程序设计》期末试卷(A卷)

[复制链接]

1万

主题

2

回帖

2万

积分

论坛元老

积分
29240
发表于 2020-5-25 13:54:10 | 显示全部楼层 |阅读模式
扫码加微信
(405)北京理工大学远程教育学院20192020学年第二学期
《脚本程序设计》期末试卷(A卷)

北京理工大学
作业请联系QQ515224986
校外学习中心学号姓名成绩
闭卷
一、单项选择题(每题2分,共30分)
1.编辑JavaScript程序时可使用的编辑工具有()。
A.只能使用记事本B.只能使用Eclipse编辑软件
C.可以使用任何一种文本编辑器D.只能使用Dreamweaver编辑工具
2.以下哪个单词不属于javascript保留字()。
A.withB.parent
C.classD.void
3.在以下选项中,最大的常量值是()。
A.020B.0X21
C.32D.43
4.下面哪一个不是浮点数()。
A.434339.35B.3.189
C.7e12D.50
5.以下生成对象的方法中,错误的是()。
A.varz=newBoolean(T)B.varstr=&quotJavaScript&quot
C.fruit=newArray(8)D.today=newDate(&quotJanuary12020&quot)    奥鹏北理工作业请联系QQ515224986
6.在以下选项中,合法的if语句首行是()。
A.if(x=0)B.if(x==0)
C.elseD.elseif
7.下列Javascript的循环语句中正确的是()。
A.if(i&lt10i++)B.for(i=0i&lt10)
C.fori=1to10D.for(i=0i&lt=10i++)
8.在以下选项中,用于标记分支结构和循环结构的语句组符号是()。
A.圆括号B.方括号
C.花括号D.以上选项均错
9.在JavaScript语言中,onChange事件不是()对象上的事件。
A.SelectB.documnet
C.TextD.Textarea
10.在JavaScript中,可以使用()来创建一个新窗口。
A.window.create()B.window.new()
C.window.open()D.document.new()
11.关于调用对象方法write(),正确的描述说法是()
A.document.write()B.windows.write()
C.document.windows.write()D.以上选项均错
12.写“HelloWorld”的正确javascript语法是()
A.response.write(&quotHelloWorld&quot)B.&quotHelloWorld&quot
C.document.write(&quotHelloWorld&quot)D.(&quotHelloWorld&quot)
13.下面()对象代表HTML文档中的超文本链接或者客户端映射表中的可单击区域。
A.windowB.document
C.linkD.history
14.button对象的()方法使按钮失去焦点。
A.blur()B.click()
C.focus()D.get()
15.XMLHttpRequest对象中()属性能够说明请求是否成功。
A.statusB.readyState
C.successD.statusText
二、填空题(每空1.5分,共30分)
1.JavaScript的特性包括、、和。
2.JavaScript中有三种对象,分别是、和。
3.表达式244/0的计算结果是。
4.表达式135%4的计算结果是。
5.设”vars=3+7+&quotvar"”,则执行完语句”document.write(s)”后,输出结果是。
6.表达式!(23&gt11)的值为。
7.JavaScript语言中三种循环语句是、和。
8.表达式(6&gt=6)&amp&amp(7&gt=6)的值为。
9.window对象的setInterval()方法用于。
10.document对象的属性可以访问文档中的所有HTML元素对象。
11.对象就是浏览器对象,用于获得与浏览器相关的信息。
12.Document对象的简单属性中的和属性来设置网页文档文本背景颜色和文档文本的文字颜色。
三、看代码段,写结果(每题7分,共28分)
1.&ltHTML&gt
&ltBODY&gt
&ltSCRIPTLANGUAGE=&quotJavaScript&quot&gt
vara=10b=20c=30
++a
a++
e=++a+(++b)+(c++)+a++
alert(e)
&lt/SCRIPT&gt
&lt/BODY&gt
&lt/HTML&gt
输出结果为:
2.&ltSCRIPTLANGUAGE=&quotJavaScript&quotTYPE=&quottext/javascript&quot&gt
vara=2
varb=3
varc=&quot2&quot
document.write(&quota=2b=3c=2&quot)document.write(&quot&ltBR&gt&quot)
document.write(&quot小于:a&ltb=&quot)
document.write(a&ltb)document.write(&quot&ltBR&gt&quot)
document.write(&quot小于等于:a&lt=b=&quot)
document.write(a&lt=b)document.write(&quot&ltBR&gt&quot)
document.write(&quot大于:a&gtb=&quot)
document.write(a&gtb)document.write(&quot&ltBR&gt&quot)
document.write(&quot大于等于:a&gt=b=&quot)
document.write(a&gt=b)document.write(&quot&ltBR&gt&quot)
document.write(&quot等于:a==c=&quot)
document.write(a==c)document.write(&quot&ltBR&gt&quot)
&lt/SCRIPT&gt
输出结果为:
3.&lthtml&gt
&lthead&gt
&lttitle&gttest&lt/title&gt
&ltscriptlanguage=&quotjavascript&quottype=&quottext/javascript&quot&gt
&lt!
//自定义构造函数
functionpen(namecolorprice)
{
this.name=name
this.color=color
if(price==undefined)
{
this.price=666
}
else
{
this.price=price
}
}
varpen1=newpen(&quot中性笔&quot&quot红色&quot80)
document.write(&quot笔1的名称为:&quot+pen1.name+&quot&ltbr&gt&quot)
document.write(&quot笔1的颜色为:&quot+pen1.color+&quot&ltbr&gt&quot)
document.write(&quot笔1的价格为:&quot+pen1.price+&quot&ltbr&gt&ltbr&gt&quot)
varpen2=newpen(&quot毛笔&quot&quot黑色&quot)
document.write(&quot笔2的名称为:&quot+pen2.name+&quot&ltbr&gt&quot)
document.write(&quot笔2的颜色为:&quot+pen2.color+&quot&ltbr&gt&quot)
document.write(&quot笔2的价格为:&quot+pen2.price+&quot&ltbr&gt&ltbr&gt&quot)
&gt
&lt/script&gt
&lt/head&gt
&ltbody&gt
&lt/body&gt
&lt/html
输出结果为:
4.&lthtml&gt
&lthead&gt
&lttitle&gttest&lt/title&gt
&lt/head&gt
&ltbody&gt
&ltpre&gt
&ltscript&gt
varstudentArray=newArray(&quotTrump&quot&quotObama&quot&quotCornell&quot&quotBush&quot)
document.writeln(studentArray.sort())
varnumberArray=newArray(25651997895017240400)
document.writeln(numberArray.sort())
&lt/script&gt
&lt/pre&gt
&lt/body&gt
&lt/html&gt
输出结果为:
四、编写程序(共12分)
在页面上编程输出2~1000之间的所有素数。(一个大于1的正整数,如果除了1和它本身以外,不能被其他正整数整除,就叫素数。如2,3,5,7,11,13,17…。)

北京理工大学
奥鹏作业请联系QQ515224986
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|www.openhelp100.com ( 冀ICP备19026749号-1 )

GMT+8, 2024-5-11 00:52

Powered by openhelp100 X3.5

Copyright © 2001-2024 5u.studio.

快速回复 返回顶部 返回列表