基于Java的哈夫曼编码译码系统报告毕业论文.docx
《基于Java的哈夫曼编码译码系统报告毕业论文.docx》由会员分享,可在线阅读,更多相关《基于Java的哈夫曼编码译码系统报告毕业论文.docx(13页珍藏版)》请在冰点文库上搜索。
基于Java的哈夫曼编码译码系统报告毕业论文
课程设计
Java与面向对象程序设计课程设计
基于Java的哈夫曼编码译码系统
1.问题描述和分工情况
1.1问题描述
使用Java语言实现哈夫曼算法,对英文文章进行编码和译码。
输入输出界面要求使用Web页面,用JSP实现。
1.2分工情况
组长:
曾庆伟
在本课程设计是负责如下工作:
1,环境的搭建(主要是web服务器的搭建)
2,代码编写工作,实现本课程设计的主要功能,即对英文的编码以与译码。
3,主要的界面设计,主要是设计jsp的界面
组员1:
徐华涛王锦贤周基霖
1,主要负责上网搜索26个英文字母在文章中出现的概率,并且根据哈夫曼算法设计出
26个字母对应的编码。
……2,画出设计的编码图…
2.系统总体设计
2.1系统设计方案综述
设计方案:
这个课程设计就是围绕着吧哈夫曼编码体现出来的目的做的
第一步是把在输入框中的字符串——也就是需要编码的文章转成01的字符串。
这里我设计成可以显示出来01字符串
第二步,在本地,也就是输入框那个jsp页面吧他的类型转成byte,这样就真正实现了他的目的——传送的时候能节省流量。
2.2系统模块设计
没什么模块的,就是一整体实现那功能。
2.3数据库设计
无数据库
2.4系统功能设计
就是简单的传送文件
2.5界面设计
很简单的黄绿两种颜色:
2.6开发环境描述
开发环境是在MacromediaDreamweaver8上进行的。
主要是因为这个课程设计的要求比较简单,还有因为方便设计界面,.
3.系统详细设计
3.1网上搜索资料abc26个英文字母出现概率
E-0.1268
T-0.0978
A-0.0788
O-0.0776
I-0.0707
N-0.0706
S-0.0634
R-0.0594
H-0.0573
L-0.0394
D-0.0389
U-0.0280
C-0.0268
F-0.0256
M-0.0244
W-0.0214
Y-0.0202
G-0.0187
P-0.0186
B-0.0156
V-0.0102
K-0.0060
X-0.0016
J-0.0010
Q-0.0009
Z-0.0006
3.2画哈夫曼编码图为(加入了字符,。
!
等等)
3.3转成编码为:
'a':
"0010"
'b':
"010010"
'c':
"111100"
'd':
"01000"
'e':
"110"
'f':
"101111"
'g':
"000010"
'h':
"111110"
'i':
"1110"
'j':
"1011001110"
'k':
"10110010"
'l':
"00000"
'n':
"1010"
'm':
"101110"
'o':
"011"
'p':
"010011"
'q':
""
'r':
"0101"
's':
"0001"
't':
"1000"
'u':
"111101"
'v':
"1011000"
'w':
"101101000"
'x':
"101100110"
'y':
"000011"
'z':
""
'':
"00110000"
',',"001111"
'.',"001110"
'\'':
"001100011"
'!
':
"00110010"
'-':
"00110011"
'(':
"0011010"
'':
"0011011"
3.4系统主要函数与其功能描述
3.5核心代码片段描述和注释
4.系统部署
4.1开发环境的建立
开发环境:
Web服务器用的是Apache
编写代码的工具:
Dreamweaver8
4.2系统运行环境的建立
运行的操作系统是windowsXP
浏览器是用IE8
4.3系统的部署和运行
5.系统测试和运行效果
5.1系统运行主要界面与其功能说明
在这个输入框中输入要编码的文章。
然后点击转成哈夫曼编码按钮即可。
5.2系统测试数据描述
输入测试文章为:
ChristmascelebrationsintheWesttoday
FromNovemberonwards,itisimpossibletoforgetthatChristmasiscoming.Colouredlightsdecoratemanytowncentresandshops,alongwithshinydecorations,andartificialsnowpaintedonshopwindows.
Instreetsandshops,'Christmastrees'(realorplasticevergreen'conifer'trees)willalsobedecoratedwithlightsandChristmasornaments.
ShoppingcentresbecomebusierasDecemberapproachesandoftenstayopentilllate.ShoppingcentrespeakersystemssystemswillplayChristmas'carols'-thetraditionalChristmasChristiansongs,andgroupsofpeoplewilloftensingcarolsonthestreetstoraisemoneyforcharity.MostplacesofworkwillholdashortChristmaspartyaboutaweekbeforeChristmas.AlthoughtraditionalChristmasfoodsmaybeeaten,drink(andplentyofit)meansthatlittleworkwillbedoneaftertheparty!
Bymid-December,mosthomeswillalsobedecoratedwithChristmastrees,colouredlightsandpaperorplasticdecorationsaroundtherooms.Thesedays,manymorepeoplealsodecorategardentreesorhousewallswithcolouredelectriclights,ahabitwhichhaslongbeenpopularinUSA.
Inmanycountries,mostpeoplepostChristmasgreetingcardstotheirfriendsandfamily,andthesecardswillbehungonthewallsoftheirhomes.InUKthisyear,theBritishPostOfficeexpectstohandleover100millioncardsEACHDAY,inthethreeweeksbeforeChristmas.
Christmascards
ThecustomofsendingChristmascardsstartedinBritainin1840whenthefirst'PennyPost'publicpostaldeliveriesbegan.(Helpedbythenewrailwaysystem,thepublicpostalservicewasthe19thcentury'scommunicationrevolution,justasemailisforustoday.)Asprintingmethodsimproved,Christmascardswereproducedinlargenumbersfromabout1860.TheybecameevenmorepopularinBritainwhenacardcouldbepostedinanunsealedenvelopeforonehalf-penny-halfthepriceofanordinaryletter.
Traditionally,Christmascardsshowedreligiouspictures-Mary,JosephandbabyJesus,orotherpartsoftheChristmasstory.Today,picturesareoftenjokes,winterpictures,FatherChristmas,orromanticscenesoflifeinpasttimes.
5.3系统运行和测试结果
运行的结果显示为:
0
然后再点击转成abc英文按钮即可转回去:
ChristmascelebrationsintheWesttoday
FromNovemberonwards,itisimpossibletoforgetthatChristmasiscoming.Colouredlightsdecoratemanytowncentresandshops,alongwithshinydecorations,andartificialsnowpaintedonshopwindows.
Instreetsandshops,'Christmastrees'(realorplasticevergreen'conifer'trees)willalsobedecoratedwithlightsandChristmasornaments.
ShoppingcentresbecomebusierasDecemberapproachesandoftenstayopentilllate.ShoppingcentrespeakersystemssystemswillplayChristmas'carols'-thetraditionalChristmasChristiansongs,andgroupsofpeoplewilloftensingcarolsonthestreetstoraisemoneyforcharity.MostplacesofworkwillholdashortChristmaspartyaboutaweekbeforeChristmas.AlthoughtraditionalChristmasfoodsmaybeeaten,drink(andplentyofit)meansthatlittleworkwillbedoneaftertheparty!
Bymid-December,mosthomeswillalsobedecoratedwithChristmastrees,colouredlightsandpaperorplasticdecorationsaroundtherooms.Thesedays,manymorepeoplealsodecorategardentreesorhousewallswithcolouredelectriclights,ahabitwhichhaslongbeenpopularinUSA.
Inmanycountries,mostpeoplepostChristmasgreetingcardstotheirfriendsandfamily,andthesecardswillbehungonthewallsoftheirhomes.InUKthisyear,theBritishPostOfficeexpectstohandleover100millioncardsEACHDAY,inthethreeweeksbeforeChristmas.
Christmascards
ThecustomofsendingChristmascardsstartedinBritainin1840whenthefirst'PennyPost'publicpostaldeliveriesbegan.(Helpedbythenewrailwaysystem,thepublicpostalservicewasthe19thcentury'scommunicationrevolution,justasemailisforustoday.)Asprintingmethodsimproved,Christmascardswereproducedinlargenumbersfromabout1860.TheybecameevenmorepopularinBritainwhenacardcouldbepostedinanunsealedenvelopeforonehalf-penny-halfthepriceofanordinaryletter.
Traditionally,Christmascardsshowedreligiouspictures-Mary,JosephandbabyJesus,orotherpartsoftheChristmasstory.Today,picturesareoftenjokes,winterpictures,FatherChristmas,orromanticscenesoflifeinpasttimes.
6.总结
6.1系统开发总结
通过本次课程设计使我对哈夫曼树与哈夫曼编码有了更深刻的理解,同时对java的编程以与算法的实现产生了比较大的兴趣。
还学到了许多在处理程序时的技巧和方法,这都对以后的学习大有裨益,以与感受到在编程设计中团队合作精神的重要性。
在这次程序设计中,我觉得重要的一点,那就是不要人云亦云,要有自己的主见,不管别人如何,一定要有自己的思想,并且始终不改变的去坚持,纵然,可能会遇到很多难以解决的困难,都要自始到终,相信自己能把这个程序做得出来。
当自己最终在自己的努力下完成任务的时候,那就会有更多属于自己的收获,包括成功的喜悦以与程序中体现的思想。
其次是我认为调试功能是整个编写程序过程中很重要的一个环节。
通过此次实验我对调试有了更加深刻的理解,懂得怎么样去调试程序,如何发现错误,如何更高效的改正,最终能把程序实现。
6.2心得体会
组长曾庆伟心得体会:
对BYTE类型的操作和持有对象的使用更加深刻了。
这个程序还是有很多不足的
虽然java是面向对象的,但是我还是用了很多面向过程的技巧来解决实际问题。
以后会多加注意。
组员1徐华涛心得体会:
通过本次课程设计,加深了我对java的了解与运用,也从中学会了怎样去写、如何去写程序。
同时也知道所有程序必须从踏踏实实中来。
组员2王锦贤心得体会:
通过本次课程设计,加深了我对java的了解与运用,同时也从这次课程设计学会了课堂上没法学会的知识。
组员3周基霖心得体会:
通过这次课程设计,加深了我对java的了解与运用,这次课程设计,我也是给组长打打下手,同时也懂得了程序该如何去写,怎样去写。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
。
……..
7.参考文献和资料
[1]《Java编程思想》……………………………………………美BruceEckel吴鹏译
[2]Java面向对象程序设计[专著]=Obiect-orientedprogrammingwithJava/亦辉,华,胡洁编著
教师评语和评分
教师评语:
教师评分:
_____________
教师签名:
日期: