




已阅读5页,还剩26页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
软件开发环境与工具实验报告学 院:计算机科学与技术学院专业班级:软件0902姓 名:肖远昊学 号:2009001553指导教师:吕进来时 间:2011年11月太原理工大学学生实验报告学院名称计算机科学与技术专业班级软09-2学号2009001553实验日期11-11学生姓名肖远昊同组人姓名实验成绩课程名称软件开发环境与工具实验题目实验一 case工具powerdesigner的使用一、实验目的:安装powerdesigner,并了解掌握powerdesigner的主要功能和使用方法。二、实验内容:1安装powerdesigner。2了解cdm的主要设计元素和设计过程。3熟悉模型转换工具的使用。4熟悉pdm的主要设计元素和设计过程。5了解设计报告的生成方法。三、实验要求:设计学生住宿管理的cdm、pdm(pdm模型最好包括:、通过cdm模型生成;、直接建立)。1学生管理(1)建立班级、院、专业cdm、pdm模型;(2)建立学生信息cdm、pdm模型,包括宿舍编号、姓名、院、专业、性别、年级、班级、出生年月、籍贯、住宿费、押金、录入日期等内容。2宿舍管理建立宿舍信息cdm、pdm模型,包括有宿舍编号、宿舍名称、宿舍电话、应住人数、录入日期等栏目。3对学生管理、宿舍管理、班级、院、专业实体(或表)之间建立联系。四、实验步骤:1运行powerdesiner安装文件。2按照安装向导,安装powerdesigner。3安装成功之后,进入powerdesigner的cdm设计界面,了解cdm的主要设计元素和设计过程。4分析住宿管理的需求,分析其中应含有的实体及其属性,建立实体联系,设计住宿管理的cdm。5检测cdm,并进行模型转换。6优化pdm。7生成设计报告。8实验结束后,整理实验报告。五、实验结果1、根据要求,运用case工具powerdesigner制作的学生住宿管理的cdm如下图:2、学生宿舍管理的pdm如下图:3、生成的sql语言截图:六、实验感想 学会了使用power designer建立cdm,将cdm转换成pdm,生成报告,生成数据库文件等等操作,我深刻体会到一个项目完整设计的难度,所以在今后的学习中,要多接触各种项目,学习不同项目设计的流程。实验室名称太原理工大学计算机科学与技术学院5楼指导老师吕进来太原理工大学学生实验报告学院名称计算机科学与技术专业班级软09-2学号2009001553实验日期11-11学生姓名肖远昊同组人姓名实验成绩课程名称软件开发环境与工具实验题目实验二: 搭建delphi开发环境,设计用户界面一、实验目的:安装 delphi,熟悉delphi开发环境。熟练掌握构成用户界面的主要控件的属性和事件。二、实验内容:1安装delphi。2熟悉常用控件的属性和事件。3掌握调整界面上控件的大小和位置的方法。三、实验要求:1编写一个简单的delphi程序要求程序运行是标签显示的文字为“first program”,当单击按钮后改变标签所显示的文字为“第一个应用程序”。2搬砖问题:36块砖,36人搬,男搬4,女搬3,两个小孩抬1砖。要求一次全搬完,问男、女、小孩个多少人?*3计算器功能增加。在calculator目录中提供的计算器程序中,没有设置mc、mr、ms、m+功能,请增加这些功能。四、实验步骤:1运行delphi的安装文件。2按照安装向导说明,完成安装。3打开delphi,进入ide,熟悉编程环境。4按照设计内容,在窗体中增加控件。5修改控件的相关属性。6调整控件大小和对齐。五、实验结果1. 第一个引用程序控件及属性label1captionfirst programsize20button1caption 单击代码:procedure tform1.button1click(sender: tobject);begin label1.caption := 第一个应用程序 ;end;end.运行界面:点击”中文”按钮后:2. 搬砖问题控件及属性:label1caption36块砖,36人搬,男搬4,女搬3, 两个小孩抬1砖。要求一次全搬完,问男、女、小孩个多少人?size15autosizefalselabel2caption计算结果:size15autosizefalsememo1scrollbarsssverticalbutton1caption计算代码:procedure tform1.button1click(sender: tobject); var x, y, z : smallint ; p : string ;begin memo1.lines.clear ; p := 男人 女人 小孩 ; memo1.lines.add(p) ; for x := 0 to 9 do for y := 0 to 10 do begin z := 36 - x - y ; if 4 * x + 3 * y + 1/2 * z = 36 then begin p := format(%3d %3d %3d , x, y, z) ; memo1.lines.add(p) ; end ; end ;end;执行界面:3. 计算器控件及属性:panel1captioncolorc_bluepanel_result caption0colorc_whitealignmenttarightjustifybevelouterbvloweredborderstylebssinglebtn_0btn_9caption0,1,2,3,4,5,6,7,8,9btn_dotcaption.btn_addcaption+btn_subtractcaption-btn_multiplycaption*btn_dividecaption/btn_equalcaptionbackspacebtn_ccaptioncbtn_cecaptioncebtn_mccaptionmcbtn_mrcaptionmrbtn_mscaptionmsbtn_maddcaptionm+代码:implementationvar input1, input2, total: double ;/操作数1,操作数2,得到结果 state : integer ;/1-输入操作数1,2-输入操作数2,3-得到结果,4-收入运算符 operator_sign : string ;/运算符 i : double ;/存储数据$r *.dfmprocedure tform1.formcreate(sender: tobject);begin input1 := 0.0 ; input2 := 0.0 ; total := 0.0 ; panel_result.caption := 0 ; state := 1 ; i := 0.0 ;end;/btn_0、btn_2btn_9共享btn_1的代码procedure tform1.btn_1click(sender: tobject); /btn_1begin if(state = 3) or (state = 4) then panel_result.caption := 0 ; if trim(panel_result.caption) = 0 then begin panel_result.caption := (sender as tbutton).caption ; end else panel_result.caption := panel_result.caption + (sender as tbutton).caption ; if state = 3 then state := 1 ; if state = 4 then state := 2 ;end;procedure tform1.btn_dotclick(sender: tobject);begin if state = 3 then begin panel_result.caption := 0 ; state := 1 ; end else if state = 4 then begin panel_result.caption := 0 ; end else if trim(panel_result.caption) = 0 then panel_result.caption := 0. else if pos(. , panel_result.caption) = 0 then panel_result.caption := panel_result.caption + . ;end;/btn_substract、btn_multiply、btn_divide共享btn_add的代码procedure tform1.btn_addclick(sender: tobject); /btn_addbegin if (state = 1) or (state = 3) then begin input1 := strtofloat(panel_result.caption) ; operator_sign := trim(sender as tbutton).caption) ; state := 4 ; end else if state = 2 then begin input2 := strtofloat(panel_result.caption) ; if operator_sign = + then total := input1 + input2 else if operator_sign = - then total := input1 - input2 else if operator_sign = * then total := input1 * input2 else if operator_sign = / then total := input1 / input2 ; panel_result.caption := floattostr(total) ; input1 := total ; state := 4 ; operator_sign := trim(sender as tbutton).caption) ; end else operator_sign := trim(sender as tbutton).caption) ;end;procedure tform1.btn_equalclick(sender: tobject); /btn_equalbegin if state = 2 then begin input2 := strtofloat(panel_result.caption) ; if operator_sign = + then total := input1 + input2 else if operator_sign = - then total := input1 - input2 else if operator_sign = * then total := input1 * input2 else if operator_sign = / then total := input1 / input2 ; panel_result.caption := floattostr(total) ; state := 3 ; end ;end;procedure tform1.btn_backspaceclick(sender: tobject); /btn_backspacevar i : integer ;begin if trim(panel_result.caption) 0 then begin if length(trim(panel_result.caption) = 1 then panel_result.caption := 0 else panel_result.caption := copy(panel_result.caption,1,length(panel_result.caption)-1) ; end ;end;procedure tform1.btn_ceclick(sender: tobject); /btn_cebegin panel_result.caption := 0 ;end;procedure tform1.btn_cclick(sender: tobject); /btn_cbegin panel_result.caption := 0 ; state := 1 ;end;procedure tform1.btn_msclick(sender: tobject); /btn_msbegin i := strtofloat(panel_result.caption) ; panel_show.caption := m ; panel_result.caption := ;end;procedure tform1.btn_mrclick(sender: tobject); /btn_mrbegin panel_result.caption := floattostr(i) ; if input1 0 then state := 2 ;end;procedure tform1.btn_maddclick(sender: tobject); /btn_maddbegin i := i + strtofloat(panel_result.caption) ;end;procedure tform1.btn_mcclick(sender: tobject); /btn_mcbegin i := 0.0 ; panel_show.caption := ; panel_result.caption := ;end;end.执行结果:mc:记忆清零mr:将记忆显示在显示屏上ms:记忆显示屏上的数据m+:将显示屏上的数据和记忆数据相加,成为新的记忆数据六、实验感想 通过这次实验,我突然觉得使用控件编程的方便性,不用去考虑过多的界面对齐方式,控件的安放位置等等令人繁琐的过程。使用delphi编写程序,简单,易行,所以学习delphi也是一个不错的选择。实验室名称太原理工大学计算机科学与技术学院5楼指导老师吕进来太原理工大学学生实验报告学院名称计算机科学与技术专业班级软09-2学号2009001553实验日期11-11学生姓名肖远昊同组人姓名实验成绩课程名称软件开发环境与工具实验题目实验三:掌握在delphi中操作数据库的方法一、实验目的:1.熟练掌握使用database desktop创建数据库表,设置表的各种属性的方法。2.掌握使用bde administrator建立数据库别名的方法。3.熟练掌握在delphi中通过bde连接数据库的方法,data access和data control常用控件的使用方法。二、实验内容:1使用database desktop创建数据库表,并设置表的各种属性。2. 使用bde administrator建立数据库别名。3. 掌握数据库的连接方法。4学会各种数据控件的使用方法。5了解在 delphi中动态改变sql语句的方法三、实验要求:1. 使用database desktop建立一个学生成绩管理数据库,其中包括3张paradox表:student表-描述学生信息;course表-描述课程信息;sc表-描述学生选课信息。各表结构如下:表1 student.dbfield nametypesizekey说明studentnoa7*学号studentnamea15姓名stubirthdayd出生日期sexa2性别studentsdepta15所在系别studentclassa15所在班级表2 course.dbfield nametypesizekey说明cnoa5*课程号cnamea15课程名ccredits学分表3 sc.dbfield nametypesizekey说明cnoa5*课程号studentnoa7*学号cgrates分数要求如下:1)建立各表。2)以student表为主表,在student表和sc表之间建立参照完整性约束,字段为studentno。3)以course表为主表,在course表和sc表之间建立引用完整性约束,字段为cno。2.为上一步建立的数据库建立数据库别名。要求如下:1)别名通过bde administrator建立。2)别名设置为s_c3设计学生成绩管理系统基本信息(三个表)录入界面要求如下:1)界面应提供录入学生成绩管理基本信息的相关控件。2)应提供增加、修改、删除、保存等功能。3)界面美观大方。4设计学生成绩管理系统的查询界面,可选择的查询条件为学号、姓名、成绩的“或”组合,显示结果包含学号、姓名、课程名称、成绩。四、实验步骤:1. 进入database desktop,建立学生成绩管理数据库表,并建立表间关系。2. 进入bde administrator,设置数据库别名。3打开delphi,进入编程界面。4选择相应的数据控件,修改相关属性,连接数据库。5填加相关事件,完成对数据库的操作。6编译、调试、运行程序。五、实验结果1. 界面的代码视图:主界面:object formmain: tformmain left = 483 top = 331 width = 643 height = 359 caption = 学生成绩管理系统 color = clbtnface font.charset = default_charset font.color = clwindowtext font.height = -11 font.name = ms sans serif font.style = oldcreateorder = false pixelsperinch = 96 textheight = 13 object panel1: tpanel left = 16 top = 8 width = 593 height = 217 bevelinner = bvraised bevelouter = bvnone bevelwidth = 3 borderstyle = bssingle font.charset = default_charset font.color = clblue font.height = -32 font.name = ms sans serif font.style = fsbold parentfont = false taborder = 0 object label1: tlabel left = 48 top = 40 width = 505 height = 73 autosize = false caption = 欢迎使用学生成绩 font.charset = default_charset font.color = clred font.height = -48 font.name = ms sans serif font.style = fsbold parentfont = false end object label2: tlabel left = 200 top = 136 width = 185 height = 37 autosize = false caption = 管理系统 end end object panel2: tpanel left = 8 top = 240 width = 601 height = 65 taborder = 1 object buttoncourse: tbutton left = 168 top = 8 width = 121 height = 49 caption = 课程信息管理 taborder = 0 onclick = buttoncourseclick end object buttongrade: tbutton left = 312 top = 8 width = 121 height = 49 caption = 成绩管理 taborder = 1 onclick = buttongradeclick end object buttonstudent: tbutton left = 16 top = 8 width = 129 height = 49 bidimode = bdlefttoright caption = 学生基本信息管理 parentbidimode = false taborder = 2 onclick = buttonstudentclick end object button1: tbutton left = 464 top = 8 width = 121 height = 49 caption = 成绩查询 taborder = 3 onclick = button1click end end object query1: tquery databasename = s_c requestlive = true left = 40 top = 40 end object datasource1: tdatasource dataset = query1 left = 80 top = 40 endend学生管理界面:object formstudent: tformstudent left = 645 top = 184 width = 553 height = 301 caption = 学生基本信息管理 color = clbtnface font.charset = default_charset font.color = clwindowtext font.height = -11 font.name = ms sans serif font.style = oldcreateorder = false onshow = formshow pixelsperinch = 96 textheight = 13 object dbgrid1: tdbgrid left = 24 top = 16 width = 489 height = 193 datasource = formmain.datasource1 taborder = 0 titlefont.charset = default_charset titlefont.color = clwindowtext titlefont.height = -11 titlefont.name = ms sans serif titlefont.style = end object dbnavigator1: tdbnavigator left = 8 top = 216 width = 520 height = 33 datasource = formmain.datasource1 taborder = 1 endend课程管理界面:object formcourse: tformcourse left = 790 top = 192 width = 353 height = 273 caption = 课程信息管理 color = clbtnface font.charset = default_charset font.color = clwindowtext font.height = -11 font.name = ms sans serif font.style = oldcreateorder = false onshow = formshow pixelsperinch = 96 textheight = 13 object dbgrid1: tdbgrid left = 56 top = 8 width = 233 height = 161 datasource = formmain.datasource1 taborder = 0 titlefont.charset = default_charset titlefont.color = clwindowtext titlefont.height = -11 titlefont.name = ms sans serif titlefont.style = end object dbnavigator1: tdbnavigator left = 16 top = 192 width = 300 height = 25 datasource = formmain.datasource1 taborder = 1 endend成绩管理界面:object formgrade: tformgrade left = 250 top = 142 width = 297 height = 256 caption = 成绩管理 color = clbtnface font.charset = default_charset font.color = clwindowtext font.height = -11 font.name = ms sans serif font.style = oldcreateorder = false onshow = formshow pixelsperinch = 96 textheight = 13 object dbgrid1: tdbgrid left = 40 top = 16 width = 209 height = 137 datasource = formmain.datasource1 taborder = 0 titlefont.charset = default_charset titlefont.color = clwindowtext titlefont.height = -11 titlefont.name = ms sans serif titlefont.style = end object dbnavigator1: tdbnavigator left = 8 top = 168 width = 260 height = 33 datasource = formmain.datasource1 taborder = 1 endend成绩查询界面:object formsearch: tformsearch left = 572 top = 245 width = 642 height = 305 caption = 成绩查询系统 color = clbtnface font.charset = default_charset font.color = clwindowtext font.height = -11 font.name = ms sans serif font.style = oldcreateorder = false onshow = formshow pixelsperinch = 96 textheight = 13 object groupbox1: tgroupbox left = 8 top = 8 width = 225 height = 217 caption = 查询选择 taborder = 0 object label1: tlabel left = 16 top = 32 width = 49 height = 17 autosize = false caption = 学号 font.charset = default_charset font.color = clwindowtext font.height = -13 font.name = ms sans serif font.style = parentfont = false end object label2: tlabel left = 16 top = 72 width = 49 height = 17 autosize = false caption = 姓名 font.charset = default_charset font.color = clwindowtext font.height = -13 font.name = ms sans serif font.style = parentfont = false end object label3: tlabel left = 16 top = 112 width = 49 height = 17 autosize = false caption = 成绩 font.charset = default_charset font.color = clwindowtext font.height = -13 font.name = ms sans serif font.style = parentfont = false end object edit1: tedit left = 80 top = 32 width = 105 height = 21 taborder = 0 end object edit2: tedit left = 80 top = 72 width = 105 height = 21 taborder = 1 end object edit3: tedit left = 80 top = 112 width = 105 height = 21 taborder = 2 end object button1: tbutton left = 56 top = 152 width = 89 height = 25 caption = 查询 taborder = 3 onclick = button1click end end object dbgrid1: tdbgrid left = 248 top = 8 width = 369 height = 233 datasource = formmain.datasource1 taborder = 1 titlefont.charset = default_charset titlefont.color = clwindowtext titlefont.height = -11 titlefont.name = ms sans serif titlefont.style = endend2. 程序源码主界面:unit unit1;interfaceuses windows, messages, sysutils, variants, classes, graphics, controls, forms, dialogs, stdctrls, extctrls, db, dbtables;type tformmain = class(tform) panel1: tpanel; buttonstudent: tbutton; buttoncourse: tbutton; buttongrade: tbutton; panel2: tpanel; query1: tquery; datasource1: tdatasource; button1: tbutton; label1: tlabel; label2: tlabel; procedure button1click(sender: tobject); procedure buttonstudentclick(sender: tobject); procedure buttoncourseclick(sender: tobject); procedure buttongradeclick(sender: tobject); private private declarations public public declarations end;var formmain: tformmain;implementationuses unit2, unit3, unit4, unit5;$r *.dfmprocedure tformmain.button1click(sender: tobject);begin formsearch := tformsearch.create(application); formsearch.showmodal; formsearch.hide; formsearch.free;end;procedure tformmain.buttonstudentclick(sender: tobject);begin formstudent := tformstudent.create(application); formstudent.showmodal; formstudent.hide; formstudent.free;end;procedure tformmain.buttoncourseclick(sender: tobject);begin formcourse := tformcourse.create(application); formcourse
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025年需求侧响应技术在智能电网调度中的应用创新
- 2025年父母赡养责任合同合同版B版
- 2025年预防接种门诊理论知识考试试卷(附参考答案)
- 哈尔滨市烟草公司2025秋招软件开发岗位面试模拟题及答案
- 中国邮政2025曲靖市秋招金融业务类岗位高频笔试题库含答案
- 绿色金融产品创新策略:2025年美国绿色金融产品创新政策研究
- 2025年度地材环保认证及采购支持服务合同
- 2025年社会工作者之初级社会综合能力基础试题库和答案要点
- 昆山市中烟工业2025秋招车间管理岗位面试模拟题及答案
- 2025年三级营销员模拟练习题与参考答案解析
- 财政投资项目评审服务投标方案(技术方案)
- 远古时期的人类活动课件
- 《新媒体营销》课件-2 直播商品卖点提炼
- 我国刑事案件现场勘查研究的现状、不足与完善
- 碳排放管理员 (碳排放核查员) 理论知识考核要素细目表五级
- 历届澳网男单冠军一览表、历史介绍
- 中国冠心病康复循证实践指南(2024版)第一部分
- DL∕T 1870-2018 电力系统网源协调技术规范
- 预防导管相关性血流感染(CDC指南解读)
- AQ 1083-2011 煤矿建设安全规范 (正式版)
- FZ∕T 54007-2019 锦纶6弹力丝行业标准
评论
0/150
提交评论