c#学生成绩查询系统

带开题报告和源代码的 ,谢谢

/*菜单函数,返回值为整数*/
menu_select()
{
char *menu[]={"***************MENU***************", /*定义菜单字符串数组*/
" 0. init list", /*初始化*/
" 1. Enter list", /*输入记录*/
" 2. Delete a record from list", /*从表中删除记录*/
" 3. print list ", /*显示单链表中所有记录*/
" 4. Search record on name", /*按照姓名查找记录*/
" 5. Save the file", /*将单链表中记录保存到文件中*/
" 6. Load the file", /*从文件中读入记录*/
" 7. compute the score", /*计算所有学生的总分和均分*/
" 8. insert record to list ", /*插入记录到表中*/
" 9. copy the file to new file", /*复制文件*/
" 10. sort to make new file", /*排序*/
" 11. append record to file", /*追加记录到文件中*/
" 12. index on nomber", /*索引*/
" 13. total on nomber", /*分类合计*/
" 14. Quit"}; /*退出*/
char s[3]; /*以字符形式保存选择号*/
int c,i; /*定义整形变量*/
gotoxy(1,25); /*移动光标*/
printf("press any key enter menu......\n"); /*压任一键进入主菜单*/
getch(); /*输入任一键*/
clrscr(); /*清屏幕*/
gotoxy(1,1); /*移动光标*/
textcolor(YELLOW); /*设置文本显示颜色为黄色*/
textbackground(BLUE); /*设置背景颜色为蓝色*/
gotoxy(10,2); /*移动光标*/
putch(0xc9); /*输出左上角边框┏*/
for(i=1;i<44;i++)
putch(0xcd); /*输出上边框水平线*/
putch(0xbb); /*输出右上角边框 ┓*/
for(i=3;i<20;i++)
{
gotoxy(10,i);putch(0xba); /*输出左垂直线*/
gotoxy(54,i);putch(0xba);
} /*输出右垂直线*/
gotoxy(10,20);putch(0xc8); /*输出左上角边框┗*/
for(i=1;i<44;i++)
putch(0xcd); /*输出下边框水平线*/
putch(0xbc); /*输出右下角边框┛*/
window(11,3,53,19); /* 制作显示菜单的窗口,大小根据菜单条数设计*/
clrscr(); /*清屏*/
for(i=0;i<16;i++) /*输出主菜单数组*/
{
gotoxy(10,i+1);
cprintf("%s",menu[i]);
}
textbackground(BLACK); /*设置背景颜色为黑色*/
window(1,1,80,25); /*恢复原窗口大小*/
gotoxy(10,21); /*移动光标*/
do{
printf("\n Enter you choice(0~14):"); /*在菜单窗口外显示提示信息*/
scanf("%s",s); /*输入选择项*/
c=atoi(s); /*将输入的字符串转化为整形数*/
}while(c<0||c>14); /*选择项不在0~14之间重输*/
return c; /*返回选择项,主程序根据该数调用相应的函数*/
}
STUDENT *init()
{
return NULL;
}

/*创建链表*/
STUDENT *create()
{
int i; int s;
STUDENT *h=NULL,*info; /* STUDENT指向结构体的指针*/
for(;;)
{
info=(STUDENT *)malloc(sizeof(STUDENT)); /*申请空间*/
if(!info) /*如果指针info为空*/
{
printf("\nout of memory"); /*输出内存溢出*/
return NULL; /*返回空指针*/
}
inputs("enter no:",info->no,11); /*输入学号并校验*/
if(info->no[0]=='@') break; /*如果学号首字符为@则结束输入*/
inputs("enter name:",info->name,15); /*输入姓名,并进行校验*/
printf("please input %d score \n",N); /*提示开始输入成绩*/
s=0; /*计算每个学生的总分,初值为0*/
for(i=0;i<N;i++) /*N门课程循环N次*/
{
do{
printf("score%d:",i+1); /*提示输入第几门课程*/
scanf("%d",&info->score[i]); /*输入成绩*/
if(info->score[i]>100||info->score[i]<0) /*确保成绩在0~100之间*/
printf("bad data,repeat input\n"); /*出错提示信息*/
}while(info->score[i]>100||info->score[i]<0);
s=s+info->score[i]; /*累加各门课程成绩*/
}
温馨提示:答案为网友推荐,仅供参考
第1个回答  2013-11-27
这个学生成绩的没怎么弄的。

就是成绩的筛选。平均,总分,最高,最低,合格率,。。。

像楼主您这样说的,要一个学生成绩管理 系统。

无非就是数据库的设计,设计好后,就是C#对数据库的操作。

没什么大功能的。顶多就是
select * from student_table where score>=60 and score<=100;
select * from student_table where score>=0 and score<=60;
select AVG(score) from student_table where subject='题目';
select SUM(score) from student_table where subject='题目';
select MAX(score) from student_table where subject='题目';
select MIN(score) from student_table where subject='题目';
......

这些都是SQL语句。

至于C#对SQL的应用,我可以写一些比较简单的例子,你可以参考,自己处理,加工成自己想要的结果。

引入
using System.Data.SqlClient;
using System.Data;

class test
{
string max_socre;//最高分;
string min_score;//最低分;
string avg_score;//平均分;
string sum_score;//某一个的总分
string pass_students;//合格者
string unpass_students;//不合格者

string connection_string=@"Integrated Security=SSPI;Persist SecurityInfo=False;Initial Catalog=数据库名;Data Source=数据源(IP地址,如果连接本机就一个".")";
string command_string="select Max(score) as 'Max_Score' from student_table where subject='数学'";
SqlConnection con=new SqlConnection(connection_string);
SqlComaand com=new SqlDataAdapter(command_string,con);
con.Open();
max_score=com.ExecuteScalar();
MessageBos.Show("数学成绩最高分是 : "+max_score);
}

这是最基本的用法。

还有更多好的用法你可以参考ADO.NET数据库连接技术。

以上我的代码是筛选最高分的。

如果你要选其的,你可以按照我上面给出的SQL语句赋值给command_string即可以。
第2个回答  2021-03-12
使用易查分三分钟就可以搭建好一个成绩查询系统哦。十分方便
第3个回答  2013-11-27
一楼的不知道什么是C#,每次都抄个C++来
寒``
第4个回答  2013-11-27
楼上哥哥用的是c吧。
c# + sql + ado.net做?
相似回答