NET站开发基础教程习题答案.doc

  1. 1、本文档共26页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
Chap01参考答案 一、填空题 1、Web XML Web services 2、公共语言运行库、.NET Framework类库 3、属性 方法 事件 4、aspx 5、cs 二、选择题 1、ABCD 2、ABCD 3、AB 4、A 5、B 三、上机操作题 1、参考1.3.1。 2、参考1.4.2。 3、在ex1_1.aspx文件中的代码如下所示: <body> <form id="form1" runat="server"> <div> <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="提交" /><br /> <asp:Label ID="Label1" runat="server" Text="您单击了0次按钮" Width="194px"></asp:Label></div> </form> </body> 在ex1_1.aspx.cs中的代码如下所示: public partial class _Default : System.Web.UI.Page { private static int i; protected void Page_Load(object sender, EventArgs e) { if(!Page.IsPostBack) i = 0; } protected void Button1_Click(object sender, EventArgs e) { i=i+1; Label1.Text = "您单击了"+i.ToString()+"次按钮"; } } Chap02参考答案 一、填空题 1、引用类型 2、object 3、显式 4、多态性 5、初始化语句右侧 二、选择题 1、AC 2、A 3、B 4、B 5、AC 三、上机操作题 1、本习题的源代码如下: namespace ex2_1 { struct student { public string name; public string address; public string tel; }; class Program { static void Main(string[] args) { student[] stu = new student[5]; for (int i = 0; i < 5; i++) { stu[i].name = Console.ReadLine(); stu[i].address = Console.ReadLine(); stu[i].tel = Console.ReadLine(); } for (int i = 0; i < 5; i++) { Console.WriteLine(i.ToString()); Console.WriteLine(stu[i].name); Console.WriteLine(stu[i].address); Console.WriteLine(stu[i].tel); } Console.ReadLine(); } } } 2、本习题的源代码如下: namespace ex2_2 { class Program { static void sort(int[] a, int n) { int temp; for (int i = 1; i < n; i++) for (int j = 0; j < n - i; j++) if (a[j] > a[j + 1]) { temp = a[j]; a[j] = a[j + 1]; a[j + 1] = temp; } } static void Main(string[] args) { int n = 5; int[] a = new int[5]; for (int i = 0; i < 5; i++) { a[i] = Convert.ToInt32(Console.ReadLine()); } sort(a, n); for (int i = 0; i < 5; i++) { Console.WriteLine(a[i].ToString()); } Console.ReadLine(); } } } 3、本习题的源代码如下: namespace ex2_3 { class student { protected string m_name; protected string m_sex; protected float m_tuition; public student(string strname, string strsex, float ftuition) { m_name = strname; m_se

文档评论(0)

beoes + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档