
不给你新做了,我给你思路(VC++6.0),你自己试一试吧,编程不能总是用现成的,自己动手才能进步。
1.建立数据结构,不用很复杂,弄个链表就行,可以从CPoint派生,或者自己写个结构体。可以采用CTypedPtrArray<CObArray,YourData*>进行链表维护。
2.根据口令进入系统,可以建立个Dlg,在APP中或CMainFrame进行d出处理。
3.表的统计不难,按需取出数据的某个属性进行处理吧。
4.排序输出可以用CListCtrl对象进行显示,则在Dlg/View中可以显示表。
希望你自己能做出来,我说的很详细了,页面的美化你自愿。
#include<stdio.h>#include<stdlib.h>
#include<string.h>
/*------------数据区--------*/
int SIZE=2
struct Spot{
char id[10] //景点编号
char name[20]//景点名称
char address[50] //景点地址
float cost //费用
}
struct Spot scenery[20]
char sub_id[10] //用于储存要查询、修改、删除景点的编号
/*-----------函数声明区--------*/
void Input(Spot scenery[],int SIZE) //录入函数
void Del(Spot scenery[],char sub_id[],int &SIZE) //删除函数
void Alter(Spot scenery[],char sub_id[],int SIZE)//修改函数
void Output(Spot scenery[],int SIZE) //显示函数
void Select(Spot scenery[],char sub_id[],int SIZE) //查询函数
void Count(Spot scenery[],int SIZE) //统计函数
void Exit() //退出函数
/*------------函数定义区-----------*/
void Input(Spot scenery[10],int SIZE)
{
int i
printf("please input\n")
printf("------------------------------------------\n")
for(i=0i<SIZEi++)
{
printf("please input id:")
gets(scenery[i].id)
printf("please input name:")
gets(scenery[i].name)
printf("please input address:")
gets(scenery[i].address)
printf("please input cost:")
scanf("%f",&scenery[i].cost)
fflush(stdin) //清空键盘缓冲区
printf("\n")
}
printf("------------------输入完毕----------------\n")
}
void Del(Spot scenery[],char sub_id[],int &SIZE)
{
int i,j
printf("please input delete spot's id:")
gets(sub_id)
for(i=0i<SIZEi++)
{
if(strcmp(scenery[i].id,sub_id)==0)
{
for(j=ij<SIZEj++)
scenery[j]=scenery[j+1]
SIZE--
}
}
printf("-------------删除成功-------------\n")
}
void Alter(Spot scenery[],char sub_id[],int SIZE)
{
int i
printf("please input alter spot's id:")
gets(sub_id)
for(i=0i<SIZEi++)
{
if(strcmp(scenery[i].id,sub_id)==0)
{
printf("alter spot's name is:")
gets(scenery[i].name)
printf("alter spot's address is:")
gets(scenery[i].address)
printf("alter spot's cost is:")
scanf("%f",&scenery[i].cost)
fflush(stdin)
break
}
}
printf("-------------修改成功------------\n")
}
void Output(Spot scenery[],int SIZE)
{
int i
printf("output scenery:\n")
printf("----------------------------------------\n")
for(i=0i<SIZEi++)
{
printf("id:%s name:%s address:%s cost:%.2f\n",scenery[i].id,scenery[i].name,scenery[i].address,scenery[i].cost)
}
printf("------------------输出完毕---------------\n")
}
void Select(Spot scenery[],char sub_id[],int SIZE)
{
int i
printf("please input select spot's id:")
gets(sub_id)
printf("-----------------查询结果--------------\n")
for(i=0i<SIZEi++)
{
if(strcmp(scenery[i].id,sub_id)==0)
printf("id:%s name:%s address:%s cost:%.2f\n",scenery[i].id,scenery[i].name,scenery[i].address,scenery[i].cost)
}
}
void Count(Spot scenery[],int SIZE)
{
int i
float sum //sum用于储存总费用
printf("-------------------统计结果------------\n")
for(i=0,sum=0i<SIZEi++)
sum+=scenery[i].cost
printf("scenery number is:%d cost is:%.2f\n",SIZE,sum)
}
void Exit()
{
printf("----------------已退出--------------\n")
exit(1)
}
/*-------------主函数----------*/
void main()
{
int s
while(1)
{
printf("please input:\n")
printf("1、录入。\n2、删除。\n3、修改。\n4、显示。\n5、查询。\n6、统计。\n7、退出。\n")
scanf("%d",&s)
fflush(stdin)
switch(s)
{
case 1:Input(scenery,SIZE)break
case 2:Del(scenery,sub_id,SIZE)break
case 3:Alter(scenery,sub_id,SIZE)break
case 4:Output(scenery,SIZE)break
case 5:Select(scenery,sub_id,SIZE)break
case 6:Count(scenery,SIZE)break
case 7:Exit()break
default:printf("please input again:")break
}
}
}
你好 我们说旅游酒店方面是离不开英语的,你CET-4最好考过了那如果说没有精力再考CET-6 可以注重口语的提高 这方面我们有初级口译 中级口译
旅游包括酒店的,所以你可以考张餐饮中级证
如果你要朝其他方面发展,那么你可以关注下会计证,市场营销都是比较热门的。。。。
因为我不知道你以后朝哪个方向发展,,,所以最好你先确定自己的防线,然后再考证书,毕竟证书太多了,,,考对以后发展有利的证书比较好。
我在江苏最好的旅游学校任教,我们学校的同学基本都会考餐饮证和导游证。除此之外,有的还考了PETS。。。。这些都是最基本的,考了这些再根据兴趣和工作需要考别的吧~~
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)