ImageVerifierCode 换一换
格式:DOCX , 页数:15 ,大小:92.92KB ,
资源ID:10261887      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bingdoc.com/d-10261887.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(集装箱优化设计实验报告.docx)为本站会员(b****3)主动上传,冰点文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰点文库(发送邮件至service@bingdoc.com或直接QQ联系客服),我们立即给予删除!

集装箱优化设计实验报告.docx

1、集装箱优化设计实验报告武 汉 工 程 大 学计算机科学与工程学院软件工程实验报告2专业班级实验地点学生学号指导教师学生姓名实验时间实验项目集装箱优化设计需求分析文档实验类别操作性() 验证性( ) 设计性( ) 综合性( ) 其它( )实验目的及要求目的:1、 集装箱优化设计的需求分析文档是软件工程课程重要内容之一。2、 通过此次设计了解需求文档设计的格式、方法和内容。3、 通过对集装箱的优化设计了解其设计模式,让集装箱在有限的空间能够存放最多的货物,从而使得节约资源最大化。要求:集装箱外部尺寸长40米,宽20米,能够存放长方形、正方形、三角形等不同形状的货物,要求装入两种或两种以上不同形状的

2、货物,使集装箱所剩的空间越小越好。成 绩 评 定 表类 别评 分 标 准分值得分合 计上机表现积极出勤、遵守纪律认真完成设计任务30分报告质量操作规范、功能正确填写完整、体现收获70分说明: 评阅教师: 日 期: 20 年 月 日实 验 内 容集装箱优化设计需求分析文档一 实验说明本实验以在集装箱中放入正方形、长方形、三角形为例,分析如何存放才能使集装箱率达到最高。实验中要用到正方形、长方形、三角形的一些数据,如:装入的正方形、长方形、三角形它们的个数是多少,正方形、长方形、三角形的边、长、宽的数据。所用的数据让用户自己输入。方案(一)方案(二)方案(三)二实验代码#include stdaf

3、x.h#include#includeusing namespace std;const float Differ = 0.05; / the differ;const int size =3;const float a=40;const float b=20;const char *p=Solution_One,Solution_Two,Solution_Three;float High =a;float Length = b;int Tri_sum=0; / count the num of the shap;int Fou_sum = 0;int Rec_sum =0;void Deal

4、_Tri( float,float ,const float ); / deal the fri;void Deal_Fou( float ,float ,const float ); / deal the fou;void Deal_Rec(float ,const float ); / deal teh rec;void Deal_backwarded(float,float ,const float);void Deal_preferential(const float,const float,const float);float MIN(const float ,const float

5、,const float); /the min length;float MIN(const float Tri_size ,const float Fou_size,const float Rec_length_size) float temp; temp=Tri_size Fou_size? Tri_size:Fou_size; temp=temp Rec_length_size? temp:Rec_length_size; couttemp= 0 & (Length - Rec_length) = 0 ) for( ; High_size = High; High_size+=(Rec_

6、high+Differ) ) +Rec_sum; if(High- High_size) = 0 & (Length - Fou_size) = 0 ) for( ; High_size = High; High_size+=(length+Differ) ) +Fou_sum; if(High- High_size) = 0 & (Length-length-Differ) = 0 ) for( ; High_size = High ; High_size+=(Tri_size+Differ) ) +Tri_sum; if( High - High_size) = 0 & (Length-l

7、ength-Differ) = 0 ) for( ; High_size = High ; High_size+=(length+Differ) +Tri_sum; if( High - High_size) (length+Differ) Length=Length-(length+Differ); / the length will reduce length + Differ; break; High_size+=Differ; void Deal_preferential(const float Solution_One,const float Solution_Two,const f

8、loat Solution_Three) float Solutionsize,Copysize; int i,j,temp; Solution0=Solution_One; Solution1=Solution_Two;Solution2=Solution_Three;/* for(i=0 ;i size ;+i) Copyi=Solutioni; for(i=0 ;isize-1 ; +i) for(j=i+1; jsize ;+j) if(Solutioni Solutionj) temp=Solutioni; Solutioni=Solutionj; Solutionj=temp; t

9、emp=Solution0; for(i=0 ;i size ;+i) if( Copyi = temp ) coutThe best way is : piendl; break; int main() / the main function;float Tri_size,Fou_size,Rec_length_size,Rec_high_size,area; float h,wide;float Solution_One,Solution_Two,Solution_Three; float Solution_One_total,Solution_Two_total,Solution_Thr

10、ee_total; coutDesign the size of the objects: n; coutThe Differ is: Differ endl; coutPlease design the size of the Tri_size : ; cinTri_size; coutPlease design the size of the Fou_size: ; cinFou_size; coutPlease design the size of the Rec_length_size: ; cinRec_length_size; coutPlease design the size

11、of the Rec_high_size: ; cinRec_high_size;coutendl; coutThe area of the container is : ; area=Area(); coutarea ( m2)endlendl; coutSolution One : nn; cout= Tri_size+Differ | Length = Fou_size+Differ | Length =Rec_length_size+Differ) Deal_Tri( Tri_size+Differ , Tri_size+Differ , Tri_size); / Deal_Fou(F

12、ou_size+Differ , Fou_size+Differ , Fou_size);/ Deal_Rec(Rec_high_size+Differ,Rec_high_size,Rec_length_size);/ Rec_length_size; coutTri_sum =Tri_sumendl; coutFou_sum =Fou_sumendl; coutRec_sum =Rec_sumendl;Solution_One_total=Tri_sum+Fou_sum+Rec_sum; coutThe total is : Solution_One_totalendl;Solution_O

13、ne=(area - Tri_sum*Tri_size*Tri_size/2.0-Fou_sum*Fou_size*Fou_size - Rec_sum*Rec_length_size*Rec_high_size); coutThe rest area of the container is : Solution_One endlendl;coutSolution Two : nn; cout= wide+Differ | Length = Fou_size+Differ | Length =Rec_high_size+Differ) Deal_Tri( h+ Differ , h+ Diff

14、er , wide ); / Deal_Fou(Fou_size+Differ , Fou_size+Differ , Fou_size);/ Deal_Rec(Rec_length_size+Differ,Rec_length_size,Rec_high_size);/ Rec_length_size; coutTri_sum =Tri_sumendl; coutFou_sum =Fou_sumendl; coutRec_sum =Rec_sumendl; Solution_Two_total=Tri_sum+Fou_sum+Rec_sum; coutThe total is : Solut

15、ion_Two_totalendl;Solution_Two=(area - Tri_sum*Tri_size*Tri_size/2.0-Fou_sum*Fou_size*Fou_size - Rec_sum*Rec_length_size*Rec_high_size); coutThe rest area of the container is : Solution_Two endlendl; coutSolution Three : nn; cout= MIN( Tri_size ,Fou_size ,Rec_length_size ) ) Deal_backwarded( Tri_siz

16、e+Differ , Differ , Tri_size ); Deal_Fou(Fou_size+Differ , Fou_size+Differ , Fou_size);/ Deal_Rec(Rec_length_size+Differ,Rec_length_size,Rec_high_size);/ Rec_length_size; coutTri_sum =Tri_sumendl; coutFou_sum =Fou_sumendl; coutRec_sum =Rec_sumendl; Solution_Three_total=Tri_sum+Fou_sum+Rec_sum; coutT

17、he total is : Solution_Three_totalendl;Solution_Three=(area - Tri_sum*Tri_size*Tri_size/2.0-Fou_sum*Fou_size*Fou_size - Rec_sum*Rec_length_size*Rec_high_size); coutThe rest area of the container is : Solution_Three endlendl; coutPlease select the preferential Solution: n; Deal_preferential(Solution_

18、One_total,Solution_Two_total,Solution_Three_total); coutFinishing selecting the preferential Solution;n; return 0;实验结果:实验总结:通过本次实验,了解如何运用C语言去做一个实用的软件,在做这个软件的时候遇到了一些困难,比如刚开始的时候不知道怎么去存放货物,通过在网上查找了一些之后,大概的了解了思路,然后在图纸上画出该集装箱的模型以及货物存放模型,从而很快地写出了代码,在这个过程中学习到如何利用网络帮助自己去解决一些问题,例如在思路无法打开的时候可以参考别人的想法,这样有利于帮助自

19、己打开思路。在今后的学习过程中要善于利用网络资源帮助自己解决一些问题,很大程度上能够让你少走弯路。总之,此次系统设计给我们提供了一个既动手又动脑、自学、独立实践的机会,使我们养成了勤翻查找各种相关资料,了解各方面的知识。将书本上的理论知识和实际有机地结合起来,锻炼了实际分析问题和解决问题的能力,提高了适应实际,实践编写的能力,为今后的学习和实践打下了良好的基础。同时我也认识到做一件事之前做好相应准备工作的重要性:不仅能够减少花费的时间,而且通过详细的分析对以后的工作的进行又很大帮助。这是第一次编写需求分析报告,可定还有很多不足的地方,以后还会接触到这方面的工作,有了这一次的经验我想以后会越做越好的。参考文献肖军模 . 程序设计语言编译 . 大连:大连理工大学出版社,2000江开耀,张俊兰等 . 软件工程 . 西安:西安电子科技大学出版社,2003Stroustrup,Bjarne. The Design and Evolution of C+ .Reading ,MA: Addison-wesley, 1994.Booch,Grady.object Analysis and Design Second Edition Reading ,MA: Addison-wesley,1993.

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

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