计算机二级《Web程序设计》试题及答案

计算机二级《Web程序设计》试题及答案,第1张

计算机二级《Web程序设计》试题及答案

1在下列的HTML中,正确产生超链接的标记是()。

A.新浪网B.新浪网C.http:///WWW.sina.Corn.cnD.新浪网

参考答案:B

2下面协议中用于在Web浏览器和服务器之间传输Web文档的是()。

A.NFSB.FTPC.HTTPD.DNS

参考答案:C

3在HTTP响应的MIME消息体中,可以同时包含如下类型的数据()。

i .文本数据 ii.图片数据 iii.视频数据 iv.音频数据

A.仅iB.i和iiC.i、ii和iiiD.全都可以

参考答案:D

4HTTP协议是一种()协议。

A.文件传输协议B.邮件协议C.远程登录协议D.超文本传输协议

参考答案:D

5在HTML文档中使用的注释符号是()。

A.//…B./*……*/C.D.以上说法均错误

参考答案:C

6HTTP请求消息中可以不包含()。

i.开始行 ii.消息头iii.消息体实体数据

A.仅iB.i和iiC.ii和 iiiD.仅iii

参考答案:C

7下列技术中控制文档结构的.是()。

A.DOMB.CSSC.JavaScriptD.XMLHttpRequest

参考答案:A

8下列语言编写的代码中,在浏览器端执行的是()。

A.wt h页面中的c#代码

B.Web页面中的Java代码

C.Web页面中的PHP代码

D.Web页面中的JavaScript代码

参考答案:D

9在HTTP/1.1协议中,持久连接选项是()的。

A.默认关闭B.默认打开C.不可协商D.以上都不对

参考答案:B

10以下不是HTTP协议的特点的是()。

A.持久连接B.请求/响应模式C.只能传输文本数据D.简单、高效

参考答案:C

11下列语句中,正确打开名为“window2"的新窗口的JavaScript语句是()。

A.open.new("http://www.sina.COB.cn","window2")

B.new.window("http://www.sina.con.cn","window2")

C.new("http://www.sina.com.cn","window2")

D.window.open("http://www.sina.tom.cn","window2")

参考答案:D

12以下选项中,全部都是表格标记的是()。

参考答案:B

13下列关于ASP.NET的描述中,错误的是()。

A.ASP.NET依赖于微软的.NET框架

B.ASP.NET采用纯面向对象语言比采用脚本语言的执行效率高

C.ASP.NET采用代码分离技术有利于开发协作

D.ASP.NET和ASP都采用了JavaScript编程语言

参考答案:D

14下列函数中能够把6.25四舍五入为最接近的整数的是()。

A.round(6.25)B.rnd(6.25)C.Math.rnd(6.25)D.Math.round(6.25)

参考答案:D

15目前在Internet上应用最为广泛的服务是()。

A.FTP服务B.Web服务C.Telnet服务D.Gopher服务

参考答案:B

16下列正确地在CSS文件中插入注释的语句是()。

A.//this is a commentB.//this is a comment//C./*this is a comment*/D.'this is a comment

参考答案:C

17下列不属于动态网页格式的是()。

A.ASPB.JSPC.ASPXD.VBS

参考答案:D

18以下语句中,正确制作电子邮件链接的是()。

参考答案:C

19下列哪个样式能够显示这样一个边框:上边框10像素、下边框5像素、左边框20像素、右边框l像素?()

A.border—width:10px 5px 20px 1px

B.border—width:10px 20px 5px 1px

C.border—width:5px 20px l0px 1px

D.border—width:10px 1px 5px 20px

参考答案:D

20CSS 主要用下列哪个HTML标记构建页面布局?()

参考答案:B

21在下列选项中,正确地产生文本区(textarea)的标记是()。

参考答案:A

22在访问的URL http://Cms.bit.edu.Cn:8080/login.aspx中,http表示()。

A.端口号B.文件名C.访问协议D.主机名

参考答案:C

23下列标记中不属于行内元素的是()。

参考答案:D

24在HTML文档中用于表示页面标题的标记对是()。

参考答案:D

25下列符合CSS语法的正确语句是()。

A.body:color=blackB.{bodycolor:black}C.body{color:black}D.{body:color=black}

参考答案:C

更多计算机二级试题推荐:

1. 2016年9月计算机二级web考试试题及答案

2. 计算机二级《Web程序设计》试题及答案

3. 计算机二级考试WEB试题及答案

4. 2016计算机二级考试《Web程序设计》练习题模拟

5. 2016计算机二级考试高级Office试题及答案

6. 2016最新计算机二级考试试题及答案

7. 2016年计算机二级office高级应用试题【题库】

8. 2016计算机二级等级考试题型分析

9. 2016下半年计算机二级ps试题及答案

10. 计算机二级Office考试试题及答案

4、以下能够提供Web服务的是( )。

A.Apache

B.IIS

C.Nginx

D.Node.js

正确答案:Apache#IIS#Nginx#Node.js

5、因特网上常用的IP地址有( )地址。

A.A类

B.B类

C.C类

D.D类

正确答案:A类#B类#C类

6、下列能够提供Apache+MySQL+PHP服务的套件是( )。

A.xampp

B.wamp

C.Nginx

D.PHPStudy

正确答案:xampp#wamp#PHPStudy

7、万维网的三大组成部分包括( )。

A.浏览器

B.脚本语言

C.Web服务器

D.超文本传输协议

正确答案:浏览器#Web服务器#超文本传输协议

8、IIS是一款开源的Web服务器软件。( )

A.正确

B.错误

正确答案:B

9、要想让Web服务器对外正常提供服务,必须给Web服务器主机配备至少一个IP地址。()

A.正确

B.错误

正确答案:A

10、Nginx提供Web服务的端口是不能更改的。()

A.正确

B.错误

正确答案:B

1、下列关于PHP中单引号和双引号包含字符串时的说法正确的是( )

A.单引号速度快,双引号速度慢

B.双引号速度快,单引号速度慢

C.单引号里面可以解析转义字符

D.双引号里面可以解析变量

正确答案:双引号里面可以解析变量

2、若x, y为整型数据,以下语句执行后$y结果为( )。$x = 5++$x$y =$x++

A.5

B.6

C.7

D.8

正确答案:6

3、在ADO.NET对象模型中,关于DataAdapter的说法中错误的是( )

A.它是数据源和DataSet之间的桥梁

B.它是一个双向通过的对象

C.一般有DataSet的地方就有它

D.它与DataSet配合,可以实现对数据库的任何 *** 作

正确答案:它与DataSet配合,可以实现对数据库的任何 *** 作

4、常见的后台脚本语言包括( )

A.PHP

B.JSP

C.JavaScript

D.ASP.NET

正确答案:PHP#JSP#ASP.NET

5、下列关于PHP变量定义错误的是( )

A.var c = 6

B.$a1 = 12

C.int b2 = 3

D.var $a = 18

正确答案:var c = 6#int b2 = 3#var $a = 18

6、关于PHP数组,下列说法错误的是( )

A.数组下标必须为数字,且从“0”开始

B.数组下标可以是字符串

C.数组元素类型必须一致

D.数组下标必须连续

正确答案:数组下标必须为数字,且从“0”开始#数组元素类型必须一致#数组下标必须连续

7、ASP.NET的关键技术包括下列方面( )

A.事件驱动

B.面向过程

C.代码隐藏技术

D.数据绑定技术

正确答案:事件驱动#代码隐藏技术#数据绑定技术

8、PHP是一种弱类型语言。

A.正确

B.错误

正确答案:A

9、ASP.NET只能运行在Windows平台。

A.正确

B.错误

正确答案:B

10、Tomcat是与PHP配合的一款Web服务器软件。

A.正确

B.错误

正确答案:B

1、MySQL属于( )数据库。

Web程序设计第3章课后题

注:课后题共7题(除第一题和第九题),其中5和8由于还有些问题没有解决,就没有将答案附上。这里的答案仅供参考,希望在上机之前能自己练习一下。程序有很多地方可以改,不要照搬。

(2)设计一个网页,其中包含TextBox和Button控件各一个。当在TextBox中输入一个成绩,再单击Button控件时在网页上输出相应的等级信息。

【.aspx】

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="question2.aspx.cs" Inherits="homework_chap3.question2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

<title></title>

</head>

<body>

<form id="form1" runat="server">

<div>

<asp:TextBox ID="TextBox1" runat="server">请输入一个成绩</asp:TextBox>

<asp:Label ID="Label1" runat="server" Text="Label">待显示</asp:Label>

<br />

<asp:Button ID="Button1" runat="server" OnClick = "btmSubmit_Click" Text="检测" />

</div>

</form>

</body>

</html>

【.aspx.cs】

using System

using System.Collections.Generic

using System.Linq

using System.Web

using System.Web.UI

using System.Web.UI.WebControls

namespace homework_chap3

{

public partial class question2 : System.Web.UI.Page

{

protected void btmSubmit_Click(object sender, EventArgs e)

{

int iInput = int.Parse(TextBox1.Text)

if (iInput >100)

Label1.Text = "请输入正确的分数"

else if(iInput >= 90)

Label1.Text = "优秀"

else if (iInput >= 80)

Label1.Text = "良好"

else if (iInput >= 60)

Label1.Text = "及格"

else if (iInput >= 0)

Label1.Text = "不及格"

else

Label1.Text = "请输入正确的分数"

}

}

}

【效果】

(3)在网页上输出九九乘法表

【.aspx.cs】(.aspx源文件可以不作处理)

using System

using System.Collections.Generic

using System.Linq

using System.Web

using System.Web.UI

using System.Web.UI.WebControls

namespace homework_chap3

{

public partial class question3 : System.Web.UI.Page

{

protected void Page_Load(object sender, EventArgs e)

{

for (int i=1i<= 9i++)

{

for (int j = 1j <= ij++)

{

Response.Write(i + "*" + j + "=" + (i * j) + "    ")

}

Response.Write("</br>")

}

}

}

}

【效果】

(4)在网页上输出如下形状:

A

BBB

CCCCC

DDD

E

【.aspx.cs】(.aspx源文件可以不作处理)

using System

using System.Collections.Generic

using System.Linq

using System.Web

using System.Web.UI

using System.Web.UI.WebControls

namespace homework_chap3.questions

{

public partial class question4 : System.Web.UI.Page

{

protected void Page_Load(object sender, EventArgs e)

{

String[] s = { "A", "B", "C", "D", "E" }

for (int i = 1i <= 3i++)

{

for (int j = 1j <= 3 - ij++)

{

Response.Write("  ")

}

for(int k = 1k <= 2*i-1k++)

{

Response.Write(s[i-1])

}

Response.Write("</br>")

}

for (int i = 1i <3i++)

{

for (int j = 1j <= ij++)

{

Response.Write("  ")

}

for (int k = 1k <= 5 - 2*ik++)

{

Response.Write(s[i + 2])

}

Response.Write("</br>")

}

}

}

}

【效果】

(6)设计一个网页,其中包含两个TextBox和一个Button控件。当在TextBox中各输入一个数值,再单击Button控件时在网页上输出两者相除的数值。(要求包含异常处理)

【.aspx】

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="question6.aspx.cs" Inherits="homework_chap3.questions.question6" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

<title></title>

</head>

<body>

<form id="form1" runat="server">

<div>

<asp:Label ID="Label1" runat="server" Text="Label">输入一个除数:</asp:Label>     

<asp:TextBox ID="TextBox1" runat="server" Width="104px"></asp:TextBox>

<br />

<asp:Label ID="Label2" runat="server" Text="Label">输入一个被除数:</asp:Label> 

<asp:TextBox ID="TextBox2" runat="server" Width="104px"></asp:TextBox>

<br />

<asp:Button ID="Button1" runat="server" OnClick="btm_click" Text="计算" /> 

<asp:Label ID="Label3" runat="server" Text="Label">答案</asp:Label>

</div>

</form>

</body>

</html>

【.aspx.ce】

using System

using System.Collections.Generic

using System.Linq

using System.Web

using System.Web.UI

using System.Web.UI.WebControls

namespace homework_chap3.questions

{

public partial class question6 : System.Web.UI.Page

{

protected void btm_click(object sender, EventArgs e)

{

int[] str = new int[1]

int iInput1 = int.Parse(TextBox1.Text)

int iInput2 = int.Parse(TextBox2.Text)

if (iInput2 == 0)

throw new Exception("除数不能为0")

else

Label3.Text = (iInput1 / iInput2).ToString()

}

}

}

【效果】

(7)设计一个用于用户注册页面的用户信息类UserInfo,它包括两个属性:姓名(Name)、生日(Birthday);一个方法DecideAge:用于判断用户是否达到规定年龄,对大于等于18岁的在页面上输出“您是成人了!”,而小于18岁的在页面上输出“您还没长大呢!”

【.aspx】

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="question7.aspx.cs" Inherits="homework_chap3.questions.question71" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">

<title></title>

</head>

<body>

<form id="form1" runat="server">

<div>

<asp:Label ID="Label3" runat="server" Text="Label"> 注册</asp:Label>

<br /><br />

<asp:Label ID="Label1" runat="server" Text="Label">姓名</asp:Label> 

<asp:TextBox ID="TextBox1" runat="server">如“朱晓栋”</asp:TextBox>

<br />

<asp:Label ID="Label2" runat="server" Text="Label">生日</asp:Label> 

<asp:TextBox ID="TextBox2" runat="server">如“19890411”</asp:TextBox>

<br />

<asp:Button ID="Button1" runat="server" OnClick="btm_click" Text="注册" />

</div>

</form>

</body>

</html>

【.aspx.cs】

using System

using System.Collections.Generic

using System.Linq

using System.Web

using System.Web.UI

using System.Web.UI.WebControls

namespace homework_chap3.questions

{

public partial class question71 : System.Web.UI.Page

{

protected void btm_click(object sender, EventArgs e)

{

int iInput2 = int.Parse (TextBox2.Text)

question7 que = new question7("zhu",19890411)

que.DecideAge(iInput2)

}

}

}

【.cs】

using System

using System.Collections.Generic

using System.Linq

using System.Web

namespace homework_chap3.questions

{

public class question7

{

private string _Name

private int _Brithday

public string Name

{

get

{

return this._Name

}

set

{

this._Name = value

}

}

public int Brithday

{

get

{

return this._Brithday

}

set

{

this._Brithday = value

}

}

public question7(String name, int brithday)

{

this._Name = name

this._Brithday = brithday

}

public void DecideAge(int brithday)

{

if (20101001 - brithday <180000)

throw new Exception("您还没长大呢!")

else

throw new Exception("您是成人了!")

}

}

}

【效果】

是这个么


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/yw/11065642.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-05-13
下一篇2023-05-13

发表评论

登录后才能评论

评论列表(0条)

    保存