综合性应用程序设计实习报告模板.docx

上传人:b****8 文档编号:9693355 上传时间:2023-05-20 格式:DOCX 页数:32 大小:304.06KB
下载 相关 举报
综合性应用程序设计实习报告模板.docx_第1页
第1页 / 共32页
综合性应用程序设计实习报告模板.docx_第2页
第2页 / 共32页
综合性应用程序设计实习报告模板.docx_第3页
第3页 / 共32页
综合性应用程序设计实习报告模板.docx_第4页
第4页 / 共32页
综合性应用程序设计实习报告模板.docx_第5页
第5页 / 共32页
综合性应用程序设计实习报告模板.docx_第6页
第6页 / 共32页
综合性应用程序设计实习报告模板.docx_第7页
第7页 / 共32页
综合性应用程序设计实习报告模板.docx_第8页
第8页 / 共32页
综合性应用程序设计实习报告模板.docx_第9页
第9页 / 共32页
综合性应用程序设计实习报告模板.docx_第10页
第10页 / 共32页
综合性应用程序设计实习报告模板.docx_第11页
第11页 / 共32页
综合性应用程序设计实习报告模板.docx_第12页
第12页 / 共32页
综合性应用程序设计实习报告模板.docx_第13页
第13页 / 共32页
综合性应用程序设计实习报告模板.docx_第14页
第14页 / 共32页
综合性应用程序设计实习报告模板.docx_第15页
第15页 / 共32页
综合性应用程序设计实习报告模板.docx_第16页
第16页 / 共32页
综合性应用程序设计实习报告模板.docx_第17页
第17页 / 共32页
综合性应用程序设计实习报告模板.docx_第18页
第18页 / 共32页
综合性应用程序设计实习报告模板.docx_第19页
第19页 / 共32页
综合性应用程序设计实习报告模板.docx_第20页
第20页 / 共32页
亲,该文档总共32页,到这儿已超出免费预览范围,如果喜欢就下载吧!
下载资源
资源描述

综合性应用程序设计实习报告模板.docx

《综合性应用程序设计实习报告模板.docx》由会员分享,可在线阅读,更多相关《综合性应用程序设计实习报告模板.docx(32页珍藏版)》请在冰点文库上搜索。

综合性应用程序设计实习报告模板.docx

综合性应用程序设计实习报告模板

综合性应用程序设计

班级:

学号:

姓名

一实验目的

●掌握分治法、递归法等模块化程序设计方法;

●通过程序设计实例掌握函数和递归函数及其应用;

二实验环境

●所需硬件环境为微机;

●所需软件环境为MicrosoftVisualC++6.0或Code:

:

Blocks;

三系统分析与设计说明

通讯录:

设计说明:

通讯录的主要功能有1。

删除名单2。

增加名单3。

查找名单

查找名单功能又分为1。

按名字查找2。

按电话号码查找

用的主要知识1,链表2。

类3。

少量的windows基础(在我的程序中主要用到的是句柄,颜色函数,窗口位置函数,清屏函数)4。

结构体5。

函数调用

四实验源代码

///////Text。

H

#ifndefTEXT_H

#defineTEXT_H

classText

{

public:

Text();

~Text();

voidCreatText(inta);

voidColor(inta);

voidWhere(intx,inty);

private:

intchange_num;

};

#endif

/////////Text.cpp

#include

#include

#include"Text.h"

Text:

:

Text()

{

change_num=1;

}

Text:

:

~Text()

{

}

voidText:

:

Where(intx,inty)

{

COORDpos;

pos.X=2*x;

pos.Y=y;

SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),pos);

}

voidText:

:

Color(inta)

{

SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),a);

}

voidText:

:

CreatText(inta)

{////////////生成文字

Color(12);

Where(27,2);

cout<<"通"<

Where(32,2);

cout<<"讯"<

Where(37,2);

cout<<"录"<

Color(13);

Where(8,4);

cout<<"功能"<

Color(14);

Where(24,4);

cout<<"姓名"<

Color(15);

Where(46,4);

cout<<"电话"<

Color(13);

Where(8,6);

cout<<"①删除联系人"<

Where(8,8);

cout<<"②添加联系人"<

Where(8,10);

cout<<"③查询号码"<

Where(8,12);

cout<<"④退出程序"<

Where(5,14);

Color(12);

cout<<"功能选择:

"<

/////生成边框框

intnum=66;

if(a<=6)

{

a=22;

}

else

{

a=20+2*(a-6);

}

for(inti=1;i

{

for(intj=1;j

{

if(i%2==1)

{Color(10);

Where(j,i);

cout<<"―"<

}

if(change_num<=10||change_num>=15)

{

change_num=10;

}

Color(change_num);

if(j%22==0)

{

Where(j,i);

cout<<"↓"<

}

}

cout<

}

change_num++;

Color(10);

}

////////Address_Book。

H

#ifndefADDRESS_BOOK_H

#defineADDRESS_BOOK_H

classAddress_Book

{

public:

Address_Book();

Address_Book(char*,char*);

~Address_Book();

voidOutputList();

voidAdd(char[20],char[13],int);

voidDelete(char[20]);

voidShow1();

voidShow2();

intCompare(char[20],int);

intCompare2(char[12],int);

intget_num();

private:

charname[20];

charnumber[12];

intnum;

};

#endif

////////////Address_Book.cpp

#include

#include"Address_Book.h"

#include

Address_Book:

:

Address_Book()

{

}

Address_Book:

:

Address_Book(char*a,char*b)

{

strcpy(name,a);

strcpy(number,b);

}

Address_Book:

:

~Address_Book()

{

}

voidAddress_Book:

:

Add(chara[20],charb[13],intc)

{

inti=0;

for(i=0;i<20;i++)

{

name[i]=a[i];

}

for(i=0;i<13;i++)

{

number[i]=b[i];

}

num=c;

}

voidAddress_Book:

:

Delete(chara[20])

{

if(strcmp(name,a)==0)

{

num=0;

}

}

voidAddress_Book:

:

Show1()

{

cout<

}

voidAddress_Book:

:

Show2()

{

cout<

}

intAddress_Book:

:

Compare(chara[20],intb)

{

if(strncmp(name,a,b)==0)

{

return1;

}

if(strncmp(name,a,b)<0)

{

return0;

}

if(strncmp(name,a,num)>0)

{

return2;

}

return3;

}

intAddress_Book:

:

Compare2(chara[12],intb)

{

intj=0;

for(inti=0;i

{

if(number[i]==a[i])

{

j++;

}

}

if(j==b)

{

return1;

}

return0;

}

intAddress_Book:

:

get_num()

{

returnnum;

}

//////main()

#include

#include

#include

#include"Address_Book.h"

#include"Text.h"

#include

#include

structnode

{

Address_BookA;

node*next;

};

voidWhere(int,int);

node*CreatList(int&);

voidoutputList(node*,int);

intmain()

{

charnum_choose;

intnum_read=-1;//用于记录链表中元素的个数

node*ListHead=NULL,*temp=NULL;

ListHead=CreatList(num_read);

outputList(ListHead,num_read);

Texttext;

text.CreatText(num_read);

Where(12,14);

num_choose=getche();

do

{

//删除一个名单

if(num_choose=='1')

{

inti,j;

temp=ListHead;

charnum2[20];

Where(2,16);

cout<<"输入所要删除人的名字,按'#'返回菜单;"<

Where(2,18);

cout<<"按'@'删除前一个字母,按'!

'键结束输入"<

for(i=0;i<100;i++)

{

Where(2+i,20);

num2[i]=getche();

num2[i+1]=0;

Where(2+i,20);

cout<<""<

if(num2[i]=='#')

{

gotoend2;

}

if(num2[i]=='!

')

{

num2[i]=0;

Where(2+i,20);

cout<<""<

break;

}

if(num2[i]=='@')

{

num2[i-1]=0;

i=i-2;

Where(2+i,20);

cout<<""<

}

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

{

if(num2[j]!

=0)

{

Where(2+j,20);

cout<

}

if(num2[j]==0)

{

num2[j+1]=0;

break;

}

}

}

while(temp)

{

temp->A.Delete(num2);

temp=temp->next;

}

ofstreamoutFile("Address_List.dat",ios:

:

out|ios:

:

binary);

while(ListHead)

{

if(ListHead->A.get_num()!

=0)

{

outFile.write((char*)&(ListHead->A),sizeof(ListHead->A));

}

ListHead=ListHead->next;

}

outFile.close();

}

///增加一个名单

if(num_choose=='2')

{

inti,j,k=0;

temp=NULL;

charnum3[20],num4[13];

intnum5=0;

Where(2,16);

cout<<"输入所要添加人的名字,按'#'返回菜单;"<

Where(2,18);

cout<<"按'@'删除前一个字母,按'!

'键结束输入"<

for(i=0;i<100;i++)

{

Where(2+i,20);

num3[i]=getche();

num3[i+1]=0;

Where(2+i,20);

cout<<""<

if(num3[i]=='#')

{

num3[i]=0;

num3[i+1]=0;

gotoend1;

}

if(num3[i]=='!

')

{

num3[i]=0;

Where(2+i,20);

cout<<""<

break;

}

if(num3[i]=='@')

{

num3[i-1]=0;

i=i-2;

Where(2+i,20);

cout<<""<

}

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

{

if(num3[j]!

=0)

{

Where(2+j,20);

cout<

}

if(num3[j]==0)

{

num3[j+1]=0;

break;

}

}

}

Where(2,22);

cout<<"输入所要添加人的号码,按'#'返回菜单;"<

Where(2,24);

cout<<"按'@'删除前一个字母,按'!

'键结束输入"<

for(i=0;i<100;i++)

{

Where(2+i,26);

num4[i]=getche();

num4[i+1]=0;

if(num4[i]=='#')

{

gotoend1;

}

if(num4[i]=='!

')

{

num4[i]=0;

Where(2+i,26);

cout<<""<

break;

}

if(num4[i]=='@')

{

num4[i-1]=0;

Where(2+i,26);

cout<<""<

i=i-2;

}

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

{

if(num4[j]!

=0)

{

Where(2+j,26);

cout<

}

if(num4[j]==0)

{

num4[j+1]=0;

break;

}

}

}

for(i=0;i<20;i++)

{

if((num3[i]>='A')&&(num3[i]<='z'))

{

num5++;

}

}

node*B1;

B1=newnode;

B1->A.Add(num3,num4,num5);

B1->next=NULL;

temp=ListHead;

node*tith;

while(temp)

{

k++;

tith=temp->next;

if((temp->A.Compare(num3,num5)==0)&&((tith->A.Compare(num3,num5)==2))&&(tith!

=NULL))

{

temp->next=B1;

B1->next=tith;

gotoend1;

}

if((temp->A.Compare(num3,num5)==1)&&k==1)

{

B1->next=temp;

ListHead=B1;

gotoend1;

}

if((tith->A.Compare(num3,num5)==1)&&(k!

=1))

{

temp->next=B1;

B1->next=tith;

gotoend1;

}

if((temp->A.Compare(num3,num5)==0)&&(tith==NULL))

{

tith->next=B1;

gotoend1;

}

/*if((temp->A.Compare(num3,num5)==2)&&(tith!

=NULL))

{

B1->next=temp;

ListHead=B1;

gotoend1;

}*/

temp=temp->next;

}

end1:

cout<

ofstreamoutFile("Address_List.dat",ios:

:

out|ios:

:

binary);

while(ListHead)

{

if(ListHead->A.get_num())

{

outFile.write((char*)&(ListHead->A),sizeof(ListHead->A));

}

ListHead=ListHead->next;

}

outFile.close();

}

if(num_choose=='4')

{

gotoend3;

}

//////查找名单

if(num_choose=='3')

{

Where(2,16);

cout<<"①按名字查找,②按号码查找"<

Where(2,18);

num_choose=getche();

Where(2,18);

cout<<""<

if(num_choose=='1')

{

charnum6[20],num8;

intnum9=6;

num8='~';

intnum7=0;

for(inti=0;i<100;i++)

{

temp=ListHead;

if(num8=='#')

{

gotoend2;

}

if(num8=='@')

{

num7--;

num6[num7]=0;

}

if((num8>='A')&&(num8<='z'))

{

num6[num7]=num8;

num7++;

}

Where(2,16);

cout<<"输入索要查找到名字,按'#'键结束返回菜单"<

Where(7,18);

cout<<"按'@'键删除"<

for(intj=0;j

{

Where(j+1,20);

cout<

}

while(temp)

{

if(temp->A.Compare(num6,num7)==1)

{

Where(24,num9);

temp->A.Show1();

Where(46,num9);

temp->A.Show2();

}

temp=temp->next;

num9=num9+2;

}

Where(2+num7,20);

num8=getche();

num9=6;

system("cls");

text.CreatText(num_read);

}

}

if(num_choose=='2')

{

charnum6[12],num8;

intnum9=6;

num8='~';

intnum7=0;

for(inti=0;i<100;i++)

{

temp=ListHead;

if(num8=='#')

{

gotoend2;

}

if(num8=='@')

{

num7--;

num6[num7]=0;

}

if((num8>='0')&&(num8<='9'))

{

num6[num7]=num8;

num7++;

}

Where(2,16);

cout<<"输入索要查找的号码,按'#'键结束返回菜单"<

Where(7,18);

cout<<"按'@'键删除"<

for(intj=0;j

{

Where(j+1,20);

cout<

}

while(temp)

{

if(temp->A.Compare2(num6,num7)==1)

{

Where(24,num9);

temp->A.Show1();

Where(46,num9);

temp->A.Show2();

}

temp=temp->next;

num9=num9+2;

}

Where(2+num7,20);

num8=getche();

num9=6;

system("cls");

text.CreatText(num_read);

}

}

}

end2:

system("cls");

num_read=-1;

ListHead=CreatList(num_read);

outputList(ListHead,num_read);

text.CreatText(num_read);

Where(12,14);

num_choose=getche();

}

while((num_choose>='1')&&(num_choose<='4'));

end3:

Where(2,16);

return0;

}

///////////////////////从文件中读取链表

node*CreatList(int&num_read)

{

node*temp=NULL,*t

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

当前位置:首页 > 法律文书

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

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