| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1453 人关注过本帖
标题:[求助]紧急求助!本月20日前要交的期末作业
只看楼主 加入收藏
lxlvic
Rank: 1
等 级:新手上路
帖 子:11
专家分:0
注 册:2006-12-18
收藏
 问题点数:0 回复次数:18 
[求助]紧急求助!本月20日前要交的期末作业
Palm os 程序设计课程设计题目

设计一个学生成绩表,数据库包含:学生姓名(name), 成绩(mark)


并且在文档中写明设计思路,流程,以及各个函数的作用


用C语言写,要求就这么简单

会的帮帮忙!!

[此贴子已经被作者于2006-12-19 10:15:29编辑过]

搜索更多相关主题的帖子: Palm 数据库 作业 name 
2006-12-18 22:27
neverTheSame
Rank: 3Rank: 3
来 自:江西农业大学
等 级:新手上路
威 望:9
帖 子:1511
专家分:0
注 册:2006-11-24
收藏
得分:0 

别人给的必竟不是自己的,
自己多想才是真


wap酷禾网(http://wap.),提供免费的、优质的、快捷的wap资源下载服务。
2006-12-18 22:34
nuciewth
Rank: 14Rank: 14Rank: 14Rank: 14
来 自:我爱龙龙
等 级:贵宾
威 望:104
帖 子:9786
专家分:208
注 册:2006-5-23
收藏
得分:0 
以下是引用lxlvic在2006-12-18 22:27:05的发言:
Palm os 程序设计课程设计题目

设计一个学生成绩表,数据库包含:学生姓名(name), 成绩(mark)

用C语言写,要求就这么简单 简单就得自己写,怎么也要自己试.

会的帮帮忙!!


倚天照海花无数,流水高山心自知。
2006-12-18 22:52
fengzar1984
Rank: 1
等 级:新手上路
帖 子:19
专家分:0
注 册:2006-3-30
收藏
得分:0 

计一个学生成绩,数据库包含:学生姓名(name), 成绩(mark)

用C语言写,要求就这么简单

会的帮帮忙!!
用c语言建表,是不是说的链表?

2006-12-19 00:07
lxlvic
Rank: 1
等 级:新手上路
帖 子:11
专家分:0
注 册:2006-12-18
收藏
得分:0 

应该是把...拜托会的帮帮忙

先应付老师下

要不我期末成绩就惨拉

拜托大家了

2006-12-19 10:01
w362034710
Rank: 1
等 级:新手上路
帖 子:169
专家分:0
注 册:2006-12-2
收藏
得分:0 

# include<stdio.h>
# include<conio.h>
# include<string.h>
# define swn 3
# define courselen 12
struct stu{
char name[10];
char code[10];
int marks[3];
int total;
struct stu *next;
}stu;
int n;
char filename[10];
char course[swn][courselen]={"chinese","math","English"};
struct stu *creatlist(int m);
writerecord(FILE *fp,struct stu *s);
void find(struct stu *t);
void printlist1(struct stu *s);
void deleted(FILE *fp,struct stu *s);
void insert(FILE *fp,struct stu *s);
void sort(FILE *fp, struct stu *t);
void printlist(struct stu *s);
void main()
{
FILE *fp;
char ch,op,th='y';
struct stu *head=NULL,*p;
clrscr();
printf("How many students are in your class? ");
scanf("%d",&n);
head=creatlist(n);
p=head;
printf("input the filename:");
scanf("%s",filename);
if((fp=fopen(filename,"r"))==NULL)
{
printf("cannot find the file~!\n");
printf("if you want to creat a file,enter 'y':");
getchar();
ch=getchar();
if(ch=='y'||ch=='Y')
{
fp=fopen(filename,"w");
while(p)
{
writerecord(fp,p);
p=p->next;
}
fclose(fp);
}
else exit(0);
}
fclose(fp);
printf("the system have been created,what do you want it to do for you?\n");
while(th=='y'||th=='Y')
{
printf("deleted: please enter '1'\n");
printf("find: please enter '2'\n");
printf("insert:please enter '3'\n");
printf("sort:please enter '4'\n");
printf("quit:please enter '5'\n");
scanf("%d",&op);
switch(op)
{
case 1: deleted(fp,head); break;
case 2: find(head); break;
case 3: insert(fp,head); break;
case 4: sort(fp,head); break;
}
if(op==5)
break;
printf("continue? please enter 'y': ");
getchar();
th=getchar();
}
printf("Thanks for your using~~!");
getch();
}
struct stu *creatlist(int m)
{
struct stu *head,*p=NULL,*rear=NULL;
int marks[3],total=0;
int i=0,j,k,h=0,a=0;
head=(struct stu*)malloc(sizeof(struct stu));
head=rear;
printf("Input the students'infomation:\n");
p=(struct stu*)malloc(sizeof(struct stu));

printf("the student's name:");
scanf("%s",p->name);
printf("the student's code:");
scanf("%s",p->code);
for(j=0;j<swn;j++)
{
printf(" ");
printf("%s:",course[j]);
scanf("%d",&marks[j]);
total=total+marks[j];
}
while((i<m-1)||(h<m))
{
for(k=0;k<3;k++)
p->marks[k]=marks[k];
p->total=total;
h++;
total=0;
rear->next=p;
rear=p;
if(a++<m-1)
{p=(struct stu*)malloc(sizeof(struct stu));

printf("the student's name:");
scanf("%s",p->name);
printf("the student's code:");
scanf("%s",p->code);
for(j=0;j<swn;j++)
{
printf(" ");
printf("%s:",course[j]);
scanf("%d",&marks[j]);
total=total+marks[j];
}
}
i++;
}
rear->next=NULL;
return (head->next);
}
writerecord(FILE *fp,struct stu *s)
{
int i;
struct stu *p;
p=s;
while(p)
{
fprintf(fp,"%3s",p->name);
fprintf(fp,"%3s",p->code);
for(i=0;i<swn;i++)
fprintf(fp,"%3d",p->marks[i]);
fputs("\n",fp);
p=p->next;
}
}
void find(struct stu *t)
{
struct stu *s=t;
char name[10];
int c=0;
printf("input the student's name you want to find:");
scanf("%s",name);
printf("The student you want to find:\n");
while(s)
{
if(strcmp(s->name,name)==0)
{
printlist(s);
c++;
}
s=s->next;
}
if(c==0)
printf("The student not exist in the system!!");
}
void printlist1(struct stu *s)
{
struct stu *p;
int i;
p=s;
while(p)
{
printf("name:");
printf("%s\n",p->name);
printf("code:");
printf("%s\n",p->code);
for(i=0;i<swn;i++)
{
printf("%s:",course[i]);
printf("%d",p->marks[i]);
printf("\n");
}
printf("total:");
printf("%d\n",p->total);
p=p->next;
}
}
void deleted(FILE *fp,struct stu *s)
{
struct stu *t,*q;
char name[10];
printf("input the name you want to delete:");
scanf("%s",name);
t=s;
fp=fopen(filename,"w");

if(strcmp(t->name,name)==0)
{
s=s->next;
writerecord(fp,t);
}
else
{
while(t&&strcmp(t->name,name)!=0)
{
q=t;
t=t->next;
}
if(!t)
{
printf("error");
return;
}
else
q->next=t->next;
}
writerecord(fp,s);
fclose(fp);
printf("the deleted system is:\n");
printlist1(s);
}
void insert(FILE *fp,struct stu *s)
{
struct stu *p,*q=NULL;
char name[10];
int total=0,i;
p=s;
fp=fopen(filename,"w");
q=(struct stu*)malloc(sizeof(struct stu));
printf("input infomation about the student:\n");
printf("student's name:");
scanf("%s",q->name);
printf("student's code:");
scanf("%s",q->code);
for(i=0;i<swn;i++)
{
printf("%s",course[i]);
printf(":");
scanf("%d",&q->marks[i]);
total+=q->marks[i];
}
q->total=total;
printf("input name that the position that you want to insert is behind:");
scanf("%s",name);
while(p&&strcmp(p->name,name)!=0)
p=p->next;
if(!p)
{
printf("error");
return;
}
else {
q->next=p->next;
p->next=q;
}
writerecord(fp,p);
fclose(fp);
printf("the inserted system is:\n");
printlist1(p);
}
void sort(FILE *fp, struct stu *t)
{
struct stu *p,*q,*r,*s,*head;
char op;
head=(struct stu*)malloc(sizeof(struct stu));
head->next=t;
r=head;
p=t;
fp=fopen(filename,"w");
printf("if you want to sort it according to 'chinese',please enter '0'\n");
printf("if you want to sort it according to 'math',please enter '1'\n");
printf("if you want to sort it according to 'English',please enter '2'\n");
scanf("%d",&op);
while(p)
{
s=p;
q=s->next;
while(q)
{
if(p->marks[op]>q->marks[op])
{
s->next=q->next;
r->next=q;
q->next=p;
q=s->next;
p=r->next;
}
else
{
s=s->next;
q=q->next;
}
}
r=r->next;
p=r->next;
}
writerecord(fp,head->next);
fclose(fp);
printf("the sorted system is:\n ");
t=head->next;
printlist1(t);
}
void printlist(struct stu *s)
{
int i;
printf("name:");
printf("%s\n",s->name);
printf("code:");
printf("%s\n",s->code);
for(i=0;i<swn;i++)
{
printf("%s:",course[i]);
printf("%d",s->marks[i]);
printf("\n");
}
printf("total:");
printf("%d\n",s->total);
}

2006-12-19 10:06
lxlvic
Rank: 1
等 级:新手上路
帖 子:11
专家分:0
注 册:2006-12-18
收藏
得分:0 
怎么这么多啊.....

楼上的你按我说的做的吗?

只要学生姓名(name), 成绩(mark)
2006-12-19 10:12
lxlvic
Rank: 1
等 级:新手上路
帖 子:11
专家分:0
注 册:2006-12-18
收藏
得分:0 

并且还要在
文档中写明设计思路,流程,以及各个函数的作用

2006-12-19 10:14
lxlvic
Rank: 1
等 级:新手上路
帖 子:11
专家分:0
注 册:2006-12-18
收藏
得分:0 

拜托楼上的帮人帮到底,帮我要在
文档中写明设计思路,流程,以及各个函数的作用

2006-12-19 10:36
lxlvic
Rank: 1
等 级:新手上路
帖 子:11
专家分:0
注 册:2006-12-18
收藏
得分:0 
以下是引用nuciewth在2006-12-18 22:52:00的发言:

斑竹,拜托你帮帮忙

没时间了,并且我一窍不通啊...

55555555555555555

2006-12-19 10:38
快速回复:[求助]紧急求助!本月20日前要交的期末作业
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.020720 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved