c语言课程设计:成绩记录簿,望高手帮忙!!!!

作者&投稿:绽柔 (若有异议请与网页底部的电邮联系)
谁能帮我做一个C语言课程设计!成绩记录簿~

你就给这点分没人给你做的

c++语言行吗>

正好有个:
#include<iostream>
#include<cstdlib>
#include<cstddef>
#include<string>
#include<iomanip>
#include<fstream>
using namespace std;

struct xueshengguanli
{ string name;
string xibie;
string banbie;
string sex;
int num;
float zongheCJ;
xueshengguanli *next;
};
typedef xueshengguanli* xueshengGL;

xueshengGL Input(xueshengGL head)
{ char SEL='y';
int m=0;
xueshengGL p1,p2,top;
ofstream out_stream;
out_stream.open("student.txt",ios::app); //以追加数据信息打开文件
if(out_stream.fail())
{ cout<<"打开文件失败.\n";
exit(1);
}
while(SEL=='y'||SEL=='Y')
{ p1=new xueshengguanli;
p1->next=NULL;
cout<<"\n请输入你的姓名:";
cin>>p1->name;
cout<<"\n请输入你的学号:";
cin>>p1->num;
cout<<"\n请输入你的性别(男/女):";
cin>>p1->sex;
cout<<"\n请输入你的系别:";
cin>>p1->xibie;
cout<<"\n请输入你的班别:";
cin>>p1->banbie;
cout<<"\n请输入你的综合成绩:";
cin>>p1->zongheCJ;
if(m==0)
{ head=p1;
p2=head;
m=1;
}
else
{ p2->next=p1;
p2=p1;
}
cout<<"\n是否继续输入?(y/n)\n"; //判断是否继续输入
cin>>SEL;
}
top=head;
//写入文件
while(head!=NULL)
{ out_stream<<head->name<<" "<<head->num<<"\t"<<head->sex<<"\t"<<head->xibie
<<"\t"<<head->banbie<<"\t"<<head->zongheCJ;
head=head->next;
}
out_stream.close(); //关闭文件
if(SEL=='n'||SEL=='N')
cout<<"输入完毕.\n";
return top; //返回链表头结点地址
}

//从文件里读取数据
xueshengGL WenJian(xueshengGL top)
{ int n=0;
xueshengGL p,h;
ifstream in_stream;
in_stream.open("student.txt");
if(in_stream.fail())
{ cout<<"打开文件失败.\n";
return 0;
}
while(1)
{ if(in_stream.eof())
break;
else
{p=new xueshengguanli;
p->next=NULL;
in_stream>>p->name>>p->num>>p->sex>>p->xibie>>p->banbie>>p->zongheCJ;
if(n==0)
{ top=p;
h=top;
n=1;
}
else
{ h->next=p;
h=p;
}
}
}
in_stream.close();
return top;
}

void xuanzhe(xueshengGL top)
{ int h;
while(h<1||h>3)
{ cout<<"\n请输入你要修改的项:";
cin>>h;
if(h==1)
{ cout<<"\n请输入新的系别:";
cin>>top->xibie;
break;
}
else if(h==2)
{ cout<<"\n请输入新的班别:";
cin>>top->banbie;
break;
}
else if(h==3)
{ cout<<"\n请输入新的综合成绩:";
cin>>top->zongheCJ;
break;
}
else
cout<<"\n输入错误!请重输!\n";
}
}

//修改
xueshengGL Change(xueshengGL top)
{ string NAME;
int NUM,l=0;
char SEL='y';
xueshengGL q,head;
cout<<"\n请输入修改人的姓名:";
cin>>NAME;
cout<<"\n请输入修改人的学号:";
cin>>NUM;
top=WenJian(top);
q=top;
while(top!=NULL)
{
if(top->name==NAME&&top->num==NUM)
{ l=1;
while(SEL=='y'||SEL=='Y')
{ cout<<"\n1系别 2班别 3综合成绩\n";
xuanzhe(top);
cout<<"\n这是修改后的学生信息:\n";
cout<<"\n姓名"<<"\t"<<"学号"<<"\t"<<"性别"<<"\t"<<"系别"<<"\t"<<"班别"<<"\t"<<"综合成绩\n";
cout<<top->name<<"\t"<<top->num<<"\t"<<top->sex<<"\t"<<top->xibie<<"\t"
<<top->banbie<<"\t"<<top->zongheCJ<<endl;
cout<<"\n是否继续修改?(y/n)\n";
cin>>SEL;
}
if(SEL=='n'||SEL=='N')
cout<<"输入完毕,任意键返回\n";
break;
}
else
top=top->next;
}
//修改后学生信息写入文件
if(l==1)
{ head=q;
ofstream out_stream;
out_stream.open("student.txt",ios::trunc); //以覆盖文件原数据方式打开文件
if(out_stream.fail())
{ cout<<"打开文件失败.\n";
exit(1);
}
while(head!=NULL)
{ out_stream<<head->name<<" "<<head->num<<"\t"<<head->sex<<"\t"<<head->xibie
<<"\t"<<head->banbie<<"\t"<<head->zongheCJ;
head=head->next;
}
out_stream.close();
}
else
cout<<"\n对不起,没有你要修改的人.\n\n";
return q;
}

//删除
xueshengGL Del(xueshengGL top)
{ string NAME;
int NUM,l=0,n=0;
xueshengGL p,h,q,back,head;
cout<<"\n请输入修改人的姓名:";
cin>>NAME;
cout<<"\n请输入修改人的学号:";
cin>>NUM;
ofstream out_stream;
ifstream in_stream;
in_stream.open("student.txt");
if(in_stream.fail())
{ cout<<"打开文件失败.\n";
cout<<"还没有学生信息\n\n";
return 0;
}
while(1)
{ if(in_stream.eof())
break;
else
{p=new xueshengguanli;
p->next=NULL;
in_stream>>p->name>>p->num>>p->sex>>p->xibie>>p->banbie>>p->zongheCJ;
if(n==0)
{ top=p;
h=top;
n=1;
}
else
{ h->next=p;
h=p;
}
}
}
in_stream.close();
q=top;
while(1)
{
if(NAME==top->name&&NUM==top->num&&top->next==NULL)
{ l=2;
top=q->next;
out_stream.open("student.txt",ios::trunc);//删除文件
break;
}
if(NAME==top->name&&NUM==top->num&&top->next!=NULL)
{ l=1;
top=q->next;
cout<<"\n删除成功.\n";
break;
}
if(q->next==NULL)
{ printf("\nNot Found!\n");
break;
}
back=q;
q=q->next;
if(NAME==q->name&&NUM==q->num)
{ l=1;
back->next=q->next;
cout<<"\n删除成功.\n";
break;
}
}
//删除学生信息后重新写入文件
if(l==1)
{ head=top;
out_stream.open("student.txt",ios::trunc);
if(out_stream.fail())
{ cout<<"打开文件失败.\n";
exit(1);
}
while(head!=NULL)
{ out_stream<<head->name<<" "<<head->num<<"\t"<<head->sex<<"\t"<<head->xibie
<<"\t"<<head->banbie<<"\t"<<head->zongheCJ;
head=head->next;
}
out_stream.close();
}
else if(l==2)
cout<<"\n删除成功.\n";
else
cout<<"\n找不到此人信息!\n";
return top;
}

//查询
xueshengGL LookUp(xueshengGL top)
{ string XM;
int number,l=0;
cout<<"\n请输入你查询的姓名:";
cin>>XM;
cout<<"\n请输入你查询的工号:";
cin>>number;
top=WenJian(top);
while(top!=NULL)
{
if(XM==top->name&&number==top->num)
{ l=1;
cout<<endl;
cout<<"\n这是你要查询人的信息.\n";
cout<<"\n姓名"<<"\t"<<"学号"<<"\t"<<"性别"<<"\t"<<"系别"<<"\t"<<"班别"<<"\t"<<"综合成绩\n";
cout<<top->name<<"\t"<<top->num<<"\t"<<top->sex<<"\t"<<top->xibie<<"\t"
<<top->banbie<<"\t"<<top->zongheCJ<<endl;
break;
}
else
top=top->next;
}
if(l==1)
cout<<"\n谢谢你的查询.\n";
else
cout<<"\n对不起,没有你要查询人的信息.\n";
cout<<endl;
return top;
}

xueshengGL sort(xueshengGL top)
{ string name1,xibie1,banbie1,sex1;
int num1;
float zongheCJ1;
int n=0,l=0;
xueshengGL p1,p2,p3,p,h,head;
ifstream in_stream;
in_stream.open("student.txt");
if(in_stream.fail())
{ cout<<"打开文件失败.\n";
cout<<"还没有学生信息保存\n\n";
return 0;
}
while(1)
{ if(in_stream.eof())
break;
else
{p=new xueshengguanli;
p->next=NULL;
in_stream>>p->name>>p->num>>p->sex>>p->xibie>>p->banbie>>p->zongheCJ;
l=1;
if(n==0)
{ top=p;
h=top;
n=1;
}
else
{ h->next=p;
h=p;
}
}
}
in_stream.close();
for(p1=top;p1->next!=NULL;p1=p1->next)
{ l=1;
for(p2=p1->next;p2!=NULL;p2=p2->next)
{
if(p1->zongheCJ<p2->zongheCJ)
{ name1=p1->name;
p1->name=p2->name;
p2->name=name1;
num1=p1->num;
p1->num=p2->num;
p2->num=num1;
sex1=p1->sex;
p1->sex=p2->sex;
p2->sex=sex1;
xibie1=p1->xibie;
p1->xibie=p2->xibie;
p2->xibie=xibie1;
banbie1=p1->banbie;
p1->banbie=p2->banbie;
p2->banbie=banbie1;
zongheCJ1=p1->zongheCJ;
p1->zongheCJ=p2->zongheCJ;
p2->zongheCJ=zongheCJ1;
}
}
}
p3=top;
cout<<"\n以下是全部学生的综合成绩由高到低的排序:\n";
cout<<"\n姓名"<<"\t"<<"学号"<<"\t"<<"性别"<<"\t"<<"系别"<<"\t"<<"班别"<<"\t"<<"综合成绩\n";
while(p3!=NULL)
{ cout<<p3->name<<"\t"<<p3->num<<"\t"<<p3->sex<<"\t"<<p3->xibie<<"\t"
<<p3->banbie<<"\t"<<p3->zongheCJ<<endl;
p3=p3->next;
}
if(l==1)
{ head=top;
ofstream out_stream;
out_stream.open("student.txt",ios::trunc); //以覆盖文件原数据方式打开文件
if(out_stream.fail())
{ cout<<"打开文件失败.\n";
exit(1);
}
while(head!=NULL)
{ out_stream<<head->name<<" "<<head->num<<"\t"<<head->sex<<"\t"<<head->xibie
<<"\t"<<head->banbie<<"\t"<<head->zongheCJ;
head=head->next;
}
out_stream.close();
}
else
cout<<"\n谢谢.\n";
cout<<endl;
return top;
}

void display(xueshengGL top)
{ int l=0,n=0;
xueshengGL p,h;
ifstream in_stream;
in_stream.open("student.txt");
if(in_stream.fail())
{ cout<<"打开文件失败.\n";
cout<<"还没有学生信息\n\n";
return;
}
while(1)
{ if(in_stream.eof())
break;
else
{p=new xueshengguanli;
p->next=NULL;
in_stream>>p->name>>p->num>>p->sex>>p->xibie>>p->banbie>>p->zongheCJ;
l=1;
if(n==0)
{ top=p;
h=top;
n=1;
}
else
{ h->next=p;
h=p;
}
}
}
in_stream.close();
if(l==1)
{ cout<<"\n以下是全部学生信息:\n";
cout<<"\n姓名"<<"\t"<<"学号"<<"\t"<<"性别"<<"\t"<<"系别"<<"\t"<<"班别"<<"\t"<<"综合成绩\n";
while(top!=NULL)
{ cout<<top->name<<"\t"<<top->num<<"\t"<<top->sex<<"\t"<<top->xibie<<"\t"
<<top->banbie<<"\t"<<top->zongheCJ<<endl;
top=top->next;
}
cout<<endl<<endl;
}
return;
}

int main()
{ xueshengGL head;
int sel;
cout<<"\n\n ---------------------------------------------\n";
cout<<"\t\t* 设计者 *\n"
<<"\t\t* *\n"
<<"\t\t* 学号: *\n";
cout<<" ---------------------------------------------\n\n";
while(1)
{ cout<<"\t\t-------------------------------\n"
<<"\t\t欢迎使用学生信息管理系统\n"
<<"\t\t 1输入学生信息\n"
<<"\t\t 2修改学生信息\n"
<<"\t\t 3删除学生信息\n"
<<"\t\t 4查找学生信息\n"
<<"\t\t 5学生综合成绩排序信息\n"
<<"\t\t 6显示学生信息\n"
<<"\t\t 0返回\n"
<<"\t\t-------------------------------\n\n\n";
cout<<"请你选择操作类型:";
cin>>sel;
cout<<"\n";
switch(sel)
{ case 1:head=Input(head);
break;
case 2:head=Change(head);
break;
case 3:head=Del(head);
break;
case 4:head=LookUp(head);
break;
case 5:head=sort(head);
break;
case 6:display(head);
break;
case 0:{ cout<<"谢谢使用再见\n\n";
exit(0);
}
default :
cout<<"输入有错误请重新输入!\n\n";
}

}
return 0;
}

呵,这血本~!真多!

吓倒我了~~~


c语言课程设计 学生成绩管理系统
希望是各位以前自己做的课程设计,网上找不到的,好答案追加100分,只能追加100分了。。。要求是,学生成绩管理... 课程设计,基本不会,正在学,但是时间来不及了,希望有朋友帮帮忙。希望是各位以前自己做的课程设计,网上找不到的,好答案追加100分,只能追加100分了。。。要求是,学生成绩管理系统,使用C语言,源程序要...

C语言课程设计报告(题目:学生成绩管理系统)
C语言课程设计报告(题目:学生成绩管理系统) 题目:学生成绩管理系统我已经做完了,但想想完善完善... 题目:学生成绩管理系统我已经做完了,但想想完善完善 展开  我来答 3个回答 #热议# 直播| 一起见证OPPO Reno7系列正式亮相! 付坤明 2010-04-09 知道答主 回答量:12 采纳率:0% 帮助的人:0 ...

汇编语言课程设计学生成绩管理子程序
数据段 字符串的数据库“ABC 文本数据库”hiaabckabiiabcyyfabcds 输出分贝数= $'数分贝 分贝?DB 3 DUP(?)数据结束 代码段 假设CS:代码,DS:数据 开始:MOV AX,数据 MOV DS斧头 MOV BX,偏移数 MOV CL,0 MOV SI,抵消字符串 MOV DI,抵消文字 MOV AL,[SI] 10:MOV AH,[二]...

c语言课程设计 学生成绩管理系统
printf("* Hwadee &学生成绩文件管理& Hwadee *\\n");printf("* *\\n");printf("***\\n\\n\\n");printf("***

C语言课程设计大作业 设计一个实用的小型学生成绩管理程序
include<iostream> include<string> include<fstream> using namespace std;class Student { public:Student(int id,char *s,double sc){ ID=id;name=s;score=sc;} Student(){} friend void Write(Student stu[],int n);friend int Read(Student stu[]);friendvoid Input(Student stu[]);frie...

c语言课程设计题目 求高人指点 学生成绩管理系统
define BUFLEN 80 \/* 缓冲区最大字符数 *\/ \/* 课程名称表 *\/ char schoolwork[SWN][NAMELEN+1] = {"Chinese","Mathematic","English"};struct record { char name[NAMELEN+1]; \/* 姓名 *\/ char code[CODELEN+1]; \/* 学号 *\/ int marks[SWN]; \/* 各课程成绩 *\/ int ...

c语言课程设计学生成绩管理系统
printf("您好,欢迎使用学生成绩管理系统\\n\\n因为您是第一次使用,请输入科目名称(三科)\\n\\n");p=fopen("c:\\\\kemu.txt","w");printf("输入课程1名称:");scanf("%s",frist[0].name);fprintf(p,"%s\\n",frist[0].name);printf("输入课程2名称:");scanf("%s",frist[1].name);fpr...

求助C语言课程设计--学生成绩管理系统 急急急
2008-07-04 c语言课程设计(学生成绩管理系统) 急求参考 (不要网上那些... 77 2014-01-05 求(C语言课程设计)学生成绩管理系统 2016-07-06 C语言课程设计学生成绩管理系统 功能:学生成绩管理系统,每个... 3 2018-07-03 C语言课程设计学生成绩管理系统 2 2011-01-25 c语言课程设计 学生成绩管理系统 ...

一、题目:成绩处理
同学,我是你们c++课程的韩虎老师,c++课设务必自己动手完成,借助其他渠道完成作业者一律取消成绩! 重视中国高校教育,从我做起,请赞。

求救:c语言课程设计,题目:学生成绩管理程序
include "stdafx.h"include "stdio.h"include "stdlib.h"struct student { int no;int grade;} *stu;int num(0);\/\/the number of this class;void sort();\/\/Sorting void enter();\/\/Input data void stat();\/\/calculate the average grade and get the unpass number void main(){ pri...

西城区15159957724: c语言课程设计:成绩记录簿,望高手帮忙!!!! -
廉常参蟾: 正好有个: #include #include #include #include #include #include using namespace std; struct xueshengguanli { string name; string xibie; string banbie; string sex; int num; float zongheCJ; xueshengguanli *next; }; typedef xueshengguanli* ...

西城区15159957724: 编制一个C语言成绩记录簿 -
廉常参蟾: 设计要求: 成绩记录簿中记录以下数据:学号、姓名、课程编号、课程名称、成绩、学分,所有成绩都以百分制计分.在程序中可以输入新的成绩记录,可以按学号或姓名查询一个学生的所有成绩,和已完成的总学分.也可以按课程编号查出一个班的成绩表,班成绩表后面要统计平均分,和及格率. 2. 提高水平 在程序中增加将数据写入文本文件和从文件中读入数据的功能,文件名由用户输入. 3. 提示 在没有使用文件时,数据可以保存在一个大的数组中,要注意的数据项的类型. 知识范围;C程序设计第三版谭浩强

西城区15159957724: 用C语言编一个成绩记录簿 -
廉常参蟾: #include <stdio.h> #include <stdlib.h> #include <string.h> #define MAX 1000 typedef struct Lesson //定义课程结构体 { int Lesson_Num; char Lesson_Name[50]; int Lesson_Mark; int Lesson_Credit; }Lesson; typedef struct Student //定义学生的结构...

西城区15159957724: 求大神指教:学生成绩记录簿设计,编制一个C语言成绩记录簿,每个学生信息包括:学号、姓名、C语言成绩. -
廉常参蟾: // 包含必须的头文件 #include<stdio.h> #include<stdlib.h> #include<string.h> // 定义课程的结构体 struct course { int num; //课程编号 char name[20]; // 课程名字 int result; // 学生的成绩 float credit; // 学分 }; // 定义成绩记录簿的结构体,每个...

西城区15159957724: 求C++高手帮我设计一下成绩记录薄!跪谢! -
廉常参蟾: //帮你写了一部分,剩下的都比较简单的,你自己做// CS201201.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include "assert.h"#include "string.h"#include #include #define M_NODE_SIZE 255#define M_...

西城区15159957724: 编制一个C语言成绩记录簿,要求每个学生信息包括:学号、姓名、C语言成绩.具体功能: (1)创建信息 -
廉常参蟾: 我以前做过的一个, 你看看,/* 数据描述:学号 姓名 班级 高数 英语 总分程序完成功能:(1) 浏览数据 (2) 增加数据 (3) 修改数据(4) 查询数据(按姓名,按总分) (5) 退出 */#include #include #include using namespace std;...

西城区15159957724: c语言编程《成绩记录簿》
廉常参蟾: #include "stdio.h" #include "stdlib.h" #include "string.h" int shoudsave=0; // struct student { char num[10];//学号 char name[20]; int cgrade; char neartime[10];//最近更新时间 }; typedef struct node { struct student data; struct node *next; }...

西城区15159957724: 编制一个c语言成绩记录簿,每个学生信息包括:学号,姓名,c语言成绩. -
廉常参蟾: /*students.c*/ #include <stdio.h> #include <string.h> #include <stdlib.h> #include "students.h"struct list //结构体 {int sno;char sname[2];int sage;char sprof[2];int sclass;struct list *next; }; stud *Create(int n) {stud *p,*c,*h;p=(stud *) malloc (...

西城区15159957724: 请把算法给我,谢了!急求!!! 编制一个C语言成绩记录簿,每个学生信息包括:学号、姓名、C语言平时 -
廉常参蟾: 给一个我以前写过的吧,功能应该差不多 #include #include #include #include #include #include #include #include #include using namespace std; /*定义学生结构体*/ struct Student { char ID[20]; char Name[20]; float Mark1; float Mark2; float Mark3...

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 星空见康网