软件环境与开发实验报告资料.docx

上传人:b****6 文档编号:7223689 上传时间:2023-05-11 格式:DOCX 页数:28 大小:559.23KB
下载 相关 举报
软件环境与开发实验报告资料.docx_第1页
第1页 / 共28页
软件环境与开发实验报告资料.docx_第2页
第2页 / 共28页
软件环境与开发实验报告资料.docx_第3页
第3页 / 共28页
软件环境与开发实验报告资料.docx_第4页
第4页 / 共28页
软件环境与开发实验报告资料.docx_第5页
第5页 / 共28页
软件环境与开发实验报告资料.docx_第6页
第6页 / 共28页
软件环境与开发实验报告资料.docx_第7页
第7页 / 共28页
软件环境与开发实验报告资料.docx_第8页
第8页 / 共28页
软件环境与开发实验报告资料.docx_第9页
第9页 / 共28页
软件环境与开发实验报告资料.docx_第10页
第10页 / 共28页
软件环境与开发实验报告资料.docx_第11页
第11页 / 共28页
软件环境与开发实验报告资料.docx_第12页
第12页 / 共28页
软件环境与开发实验报告资料.docx_第13页
第13页 / 共28页
软件环境与开发实验报告资料.docx_第14页
第14页 / 共28页
软件环境与开发实验报告资料.docx_第15页
第15页 / 共28页
软件环境与开发实验报告资料.docx_第16页
第16页 / 共28页
软件环境与开发实验报告资料.docx_第17页
第17页 / 共28页
软件环境与开发实验报告资料.docx_第18页
第18页 / 共28页
软件环境与开发实验报告资料.docx_第19页
第19页 / 共28页
软件环境与开发实验报告资料.docx_第20页
第20页 / 共28页
亲,该文档总共28页,到这儿已超出免费预览范围,如果喜欢就下载吧!
下载资源
资源描述

软件环境与开发实验报告资料.docx

《软件环境与开发实验报告资料.docx》由会员分享,可在线阅读,更多相关《软件环境与开发实验报告资料.docx(28页珍藏版)》请在冰点文库上搜索。

软件环境与开发实验报告资料.docx

软件环境与开发实验报告资料

本科实验报告

 

课程名称:

软件开发环境与工具

实验项目:

CASE工具PowerDesigner的使用

实验地点:

专业班级:

学号:

学生姓名:

指导教师:

年月日

实验名称

实验一CASE工具PowerDesigner的使用

实验目的和要求

目的:

安装PowerDesigner,并了解、掌握PowerDesigner的主要功能和使用方法。

要求:

1.安装PowerDesigner。

2.了解CDM的主要设计元素和设计过程。

3.熟悉模型转换工具的使用。

4.熟悉PDM的主要设计元素和设计过程。

实验内容

设计学生住宿管理的CDM、PDM(PDM模型最好包括:

1、通过CDM模型生成;2、直接建立)。

1.学生管理

(1)建立班级、院、专业CDM、PDM模型;

(2)建立学生信息CDM、PDM模型,包括学号、姓名、院、专业、性别、年级、班级、出生年月、籍贯、住宿费、押金、录入日期及宿舍编号等内容。

2.宿舍管理

建立宿舍信息CDM、PDM模型,包括有宿舍编号、宿舍名称、宿舍电话、应住人数、录入日期等栏目。

3.对学生管理、宿舍管理、班级、院、专业实体(或表)之间建立联系。

主要仪器设备

笔记本计算机

实验记录(写出实验内容中1,2,3的CDM图和PDM图)(可分栏或加页)

1.学生住宿管理的CDM如下图:

2.学生住宿管理的PDM如下图:

 

遇到的问题和解决方法

1.CDM检查中出现大量错误,多次尝试检查,多次运行;

1.模型转换过程中,找不到位置,对实验工具不熟悉。

心得体会

经过实验,了解了CDM的主要设计元素和设计过程,熟悉了模型转换工具的使用,熟悉了PDM的主要设计元素和设计过程。

初步了解了PowerDesigner。

实验名称

实验二搭建VisualStudio开发环境,设计Windows控制台应用程序

实验目的和要求

目的:

安装VisualStudio2010,熟悉VisualStudio2010开发环境。

熟练掌握C#的语法、语句结构,并能进行控制台应用程序的编写。

要求:

1.安装VisualStudio2010。

2.熟悉掌握C#的语法、语句结构。

3.掌握控制台应用程序的设计方法。

实验内容

1.编写控制台程序:

输入矩形的长和宽,输出矩形的面积和周长。

2.编写控制台应用程序,输入正整数n,输出s=1+(1+2)+(1+2+3)+…+(1+2+3+…+n)的计算结果。

3.编写控制台应用程序,输出所有这样的三位数:

这个三位数本身恰好等于其每个数字的立方和(例153=13+53+33)。

主要仪器设备

台式或笔记本计算机,VisualStudio2010

实验记录(写出实验内容中1,2,3的程序代码和运行结果)

 

1.实验代码:

usingSystem;

usingSystem.Collections.Generic;

usingSystem.Linq;

usingSystem.Text;

namespace_3

{

classshiyan3

{

staticvoidMain(string[]args)

{

inta,b,area,zhouchang;

Console.WriteLine("请输入长方形长");

a=int.Parse(Console.ReadLine());

Console.WriteLine("请输入长方形宽");

b=int.Parse(Console.ReadLine());

area=a*b;

zhouchang=(a+b)*2;

Console.WriteLine("周长为{0}",zhouchang);

Console.WriteLine("面积为{0}",area);

}

}

}

运行结果:

2.实验代码:

usingSystem;

usingSystem.Collections.Generic;

usingSystem.Linq;

usingSystem.Text;

namespace_3_2

{

classProgram

{

staticvoidMain(string[]args)

{

ints=0;

inti;

intj;

intn;

Console.WriteLine("请输入n:

");

n=int.Parse(Console.ReadLine());

for(i=1;i<=n;i++)

{

for(j=1;j<=i;j++)

s+=j;

}

Console.WriteLine("s的值为{0}",s);

 

}

}

}

 

运行结果:

 

3.实验代码:

usingSystem;

usingSystem.Collections.Generic;

usingSystem.Linq;

usingSystem.Text;

namespace_3_3

{

classProgram

{

staticvoidMain(string[]args)

{

inti;

intj;

intk;

intsum;

intq;

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

for(j=0;j<=9;j++)

for(k=0;k<=9;k++)

{

sum=i*i*i+j*j*j+k*k*k;

q=100*i+10*j+k;

if(sum==q)

Console.WriteLine(q);

}

}

}

}

运行结果:

遇到的问题和解决方法

在循环条件设计中语法掌握不熟悉,思路不清晰,出现了一些错误,经过仔细分析,通过数据调试发现问题,进而解决问题,纠正错误。

心得体会

经过试验,熟悉了掌握C#的语法、语句结构。

掌握了控制台应用程序的设计方法。

实验名称

实验三掌握在VisualStudio2010中进行WindowsForm应用程序的设计方法

实验目的和要求

目的:

熟悉利用C#进行Windows窗体应用程序的设计方法,了解Windows窗体应用程序的组成。

要求:

1.熟练掌握C#窗体和各种常用控件的属性、方法和事件。

2.掌握C#中使用各种常用控件设计界面的方法。

3.掌握C#中窗体事件处理机制。

实验内容

1.创建一个Windows窗体应用程序,向其中添加一个窗体,实现用户登录(输入用户名和口令,假设正确的用户名/口令为zy1001_2/10011002),并给出相应的提示信息。

规定用户错误输入不超过3次。

2.搬砖问题:

36块砖,36人搬,男搬4,女搬3,两个小孩抬1砖。

要求一次全搬完,问男、女、小孩各多少人?

3.设计一个窗体,通过一个列表框向组合框中添加项。

主要仪器设备

台式或笔记本计算机,VisualStudio2010

实验记录(写出实验内容中1,2,3的程序代码和运行结果)

对于本次实验的步骤有首先得对C#窗口应用程序设计环境进行了解,熟悉windows窗口程序开发环境,进而完成实验。

实验代码1(用户登录):

usingSystem;

usingSystem.Collections.Generic;

usingSystem.ComponentModel;

usingSystem.Data;

usingSystem.Drawing;

usingSystem.Linq;

usingSystem.Text;

usingSystem.Threading.Tasks;

usingSystem.Windows.Forms;

namespace开发环境与工具实验四_1_

{

publicpartialclassForm1:

Form

{

publicForm1()

{

InitializeComponent();

}

inti=1;

privatevoidbtnlog_Click(objectsender,EventArgse)

{

if(i==3)

{

MessageBox.Show("登录次数太多!

","退出警告");

Application.Exit();

}

else

{

if(tbname.Text=="zy1001_2")

{

if(tbpsw.Text=="10011002")

MessageBox.Show("登录成功!

","登录成功");

else

{

intm=3-i;

MessageBox.Show("密码错误!

","密码错误");

labwarn.Visible=true;

labwarn.Text="还有"+m+"次登录机会!

";

i++;

}

}

else

MessageBox.Show("账号错误!

","账号错误");

}

}

}

}

实验代码2(搬砖问题):

usingSystem;

usingSystem.Collections.Generic;

usingSystem.ComponentModel;

usingSystem.Data;

usingSystem.Drawing;

usingSystem.Linq;

usingSystem.Text;

usingSystem.Windows.Forms;

namespaceCA4_02

{

publicpartialclassForm1:

Form

{

publicForm1()

{

InitializeComponent();

}

privatevoidbutton1_Click(objectsender,EventArgse)

{

intman,woman,child;

for(man=0;man<=9;man++)

{

for(woman=0;woman<=12;woman++)

{

child=36-woman-man;

if(36==child/2+3*woman+4*man&&child%2==0)

{

listBox1.Items.Add("男人为:

"+man);

listBox1.Items.Add("女人为:

"+woman);

listBox1.Items.Add("小孩为:

"+child);

}

}

}

}

privatevoidlistBox1_SelectedIndexChanged(objectsender,EventArgse){}

privatevoidForm1_Load(objectsender,EventArgse){}

privatevoidtextBox1_TextChanged(objectsender,EventArgse){}

}

}

运行结果:

3.实验代码:

usingSystem;

usingSystem.Collections.Generic;

usingSystem.ComponentModel;

usingSystem.Data;

usingSystem.Drawing;

usingSystem.Linq;

usingSystem.Text;

usingSystem.Windows.Forms;

namespaceCA4_3

{

publicpartialclassForm1:

Form

{

publicForm1()

{

InitializeComponent();

}

privatevoidbutton1_Click(objectsender,EventArgse)

{

if(listBox1.Text!

="")

if(!

comboBox1.Items.Contains(listBox1.Text))

comboBox1.Items.Add(listBox1.Text);

}

privatevoidForm1_Load(objectsender,EventArgs{}

privatevoidlistBox1_SelectedIndexChanged(objectsender,EventArgse){}

privatevoidcomboBox1_SelectedIndexChanged(objectsender,EventArgse){}

}

}

运行结果:

遇到的问题和解决方法

在对组合框编程时,对于条件逻辑关系不是很清楚,所以编写过程遇到了一些困难。

但是,通过查阅资料,对于内容有了更深入地了解,解决了问题,调试成功。

心得体会

通过实验,熟练掌握了C#窗体和各种常用控件的属性、方法和事件。

掌握了C#中使用各种常用控件设计界面的方法。

掌握了C#中窗体事件处理机制。

 

实验名称

实验四掌握在VisualStudio2010中进行Web应用程序的设计方法

实验目的和要求

目的:

熟悉利用C#进行Web应用程序的设计方法,了解Web应用程序的组成。

要求:

1.掌握开发Web应用程序的步骤。

2.掌握常用的Web服务器控件的使用方法。

3.掌握C#中窗体事件处理机制。

4.掌握C#数据库编程的方法。

实验内容

1.实现教师信息的录入功能,并将教师信息保存在数据库中的teacher表中。

教师信息由教师编号、姓名、性别、年龄、民族、职称、职务及教龄组成。

设置一个简单的Web应用程序,用来输入教师信息。

要求:

1)进行各种信息的有效性检验(教师编号、姓名不能为空;年龄在20—65之间;教龄在0—45年之间);2)把输入的完整信息在屏幕上显示出来。

(注意:

民族、职称、职务通过下拉框输入;性别通过单选按钮组输入)。

2.创建一个Web应用程序,实现用户登录,检查用户名和口令的合法性(用户的登录信息维护在数据库中的Tuser表中,该表包括两个varchar(10)的字段:

username与password字段),,并给出相应的提示信息。

主要仪器设备

台式或笔记本计算机

实验记录(写出实验内容中1,2的程序代码和运行结果)(可分栏或加页)

//www.w3.org/1999/xhtml">

教师登录系统

LabelID="Label1"runat="server"Text="教师编号">

Label>

TextBoxID="TextBox1"runat="server"Width="154px">

TextBox>

RequiredFieldValidatorID="RequiredFieldValidator1"runat="server"

ErrorMessage="此项不能为空"ControlToValidate="TextBox1">

RequiredFieldValidator>

LabelID="Label2"runat="server"Text="姓    名">

Label>

TextBoxID="TextBox2"runat="server"Width="154px">

TextBox>

RequiredFieldValidatorID="RequiredFieldValidator2"runat="server"

ErrorMessage="此项不能为空"ControlToValidate="TextBox2">

RequiredFieldValidator>

LabelID="Label3"runat="server"Text="性    别">

Label>

RadioButtonListID="RadioButtonList1"runat="server">

ListItem>男

ListItem>

ListItem>女

ListItem>

ListItem>单身女博士

ListItem>

RadioButtonList>

LabelID="Label4"runat="server"Text="年    龄">

Label>

TextBoxID="TextBox3"runat="server"Width="154px">

TextBox>

RangeValidatorID="RangeValidator1"runat="server"ErrorMessage="超出规定范围"

ControlToValidate="TextBox3">

RangeValidator>

LabelID="Label5"runat="server"Text="民    族">

Label>

DropDownListID="DropDownList1"runat="server">

ListItem>汉族

ListItem>

ListItem>回族

ListItem>

ListItem>维吾尔族

ListItem>

ListItem>满族

ListItem>

DropDownList>

LabelID="Label6"runat="server"Text="职    称">

Label>

DropDownListID="DropDownList2"runat="server">

ListItem>初级

ListItem>

ListItem>中级

ListItem>

ListItem>高级

ListItem>

DropDownList>

LabelID="Label7"runat="server"Text="职    务">

Label>

DropDownListID="DropDownList3"runat="server">

ListItem>老师

ListItem>

ListItem>主任

ListItem>

ListItem>校长

ListItem>

DropDownList>

LabelID="Label9"runat="server"Text="教    龄">

Label>

TextBoxID="TextBox4"runat="server"Width="154px">

TextBox>

RangeValidatorID="RangeValidator2"runat="server"ErrorMessage="超出规定范围"

ControlToValidate="TextBox4">

RangeValidator>

   

ButtonID="Button1"runat="server"Text="注    册"/>   

ButtonID="Button2"

runat="server"Text="重新输入"/>

运行结果:

3.代码

usingSystem;

usingSystem.Collections.Generic;

usingSystem.Linq;

usingSystem.Web;

usingSystem.Web.UI;

usingSystem.Web.UI.WebControls;

usingSystem.Data.SqlClient;

usingSystem.Configuration;

publicpartialclassDefault2:

System.Web.UI.Page

{

protectedvoidPage_Load(objectsender,EventArgse)

{

}

protectedvoidLogin1_Authenticate(objectsender,AuthenticateEventArgse)

{

}

protectedvoidLogin1_Authenticate1(objectsender,AuthenticateEventArgse)

{

SqlConnectioncon=newSqlConnection();

con.ConnectionString=@"Server=CZY-PC;uid=

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

当前位置:首页 > IT计算机 > 电脑基础知识

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2