學生成績管理系統matlab課程設計
⑴ 學生成績管理 matlab gui
學生刪除和信息修改 就沒有做了 後面的要求都有 不知道要不要參考下??
滿意請採納。
⑵ 學生成績管理系統課程設計
你好,我曾用c++學生成績管理系統的程序,希望能對你有所幫助。
#include <string.h>
#include <iostream.h>
#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
/*------------------------------------定義類部分------------------------------------------------*/
class Node
{
char name[10];
int score;
class Node *next;
public:
Node* CreateNode(int n);
void PrinfListNode(Node *h);
void InsertList(Node *h,int i,char name[],int e,int *n);
void DeleteList(Node *h,int i,int *n);
Node* operator +=(Node *p);
Node *Unique(Node *p,int *n);
};
void DisplayNote(void);
/*--------------------建立單鏈表的成員函數,單鏈表節點的個數不確定--------------------------------*/
Node *Node::CreateNode(int n)
{
Node *head;
Node *pre,*p;
int i;
head=(Node*)malloc(sizeof(Node)); //用malloc動態申請內存,個數作為函數的輸入參數
head->next=NULL;
pre=head;
for (i=1;i<=n;i++)
{
printf("請輸入學生姓名:",i);
p=(Node*)malloc(sizeof(Node));
scanf("%s",p->name);
printf("請輸入此學生的分數:",i);
scanf("%d",&p->score);
pre->next=p;
pre=p;
}
p->next=NULL;
return head;
}
/*---------------------------------輸出鏈表函數實現部分------------------------------------------*/
void Node::PrinfListNode(Node *h)
{
Node *p;
p=h->next;
while(p)
{
printf("name:%s\tscore:%d",p->name,p->score);
p=p->next;
printf("\n");
}
}
/*----------------------------實現單鏈表的插入操作的成員函數--------------------------------------*/
void Node::InsertList(Node *h,int i,char name[],int e,int *n)
{
Node *p,*q;
int j;
if (i<1||i>(*n)+1)
{
printf("出錯啦!請重試!.\n");
}
else
{
j=0;p=h;
while(j<i-1)
{
p=p->next;
j++;
}
q=(Node *)malloc(sizeof(Node));
strcpy(q->name,name);
q->score=e;
q->next=p->next;
p->next=q;
(*n)++;
}
}
/*-----------------------------實現單鏈表的刪除操作的成員函數-------------------------------------*/
void Node::DeleteList(Node *h,int i,int *n)
{
Node *p,*q;
int j;
char name[10];
int score;
if (i<1||i>(*n))
{
printf("出錯啦!請重試!.\n");
}
else
{
j=0;p=h;
while(j<i-1)
{
p=p->next;
j++;
}
q=p->next;
p->next=q->next;
strcpy(name,q->name);
score=q->score;
free(q);
(*n)--;
}
}
/*--------------------------重載運算符「+=」實現兩個鏈表對象合並功能------------------------------*/
Node *Node::operator +=(Node *p)
{
Node *q=this;
while(q->next!=NULL) //把第一個鏈表最後的next指向第二個的頭
{
q=q->next;
}
q->next=p->next;
return this;
}
/*----------------編寫Unique()成員函數,實現剔除鏈表中重復元素,使所有節點值唯-----------------*/
Node *Node::Unique(Node *p,int *n)
{ Node *q=this,*k,*m;
int i;
if((*n)<=1) //用循環,拿一個和每一個去比較,一樣的刪除使用已經寫好的刪除函數
cout<<"ERROR!"<<endl;
else
{
for(i=1;i<(*n);q=q->next)
{
k=q;
p=q->next;
while(p!=NULL)
{
if(strcmp(q->name,p->name)==0)
{
m=p;
p=p->next;
k->next=m->next;
free(m);
(*n)--;
}
else{
k=p;
p=p->next;
}
}
}
}
return this;
}
/*--------------------------------編寫主函數測試上述功能---------------------------------------*/
int main()
{
Node *h,*k;
int i=1,n,score;
char name[10];
int *m=0;
while(i)
{
DisplayNote();
scanf("%d",&i);
switch(i)
{
case 1:
printf("請輸入表中成員的個數:\n");
scanf("%d",&n);
h=h->CreateNode(n);
printf("表中成員為:\n");
h->PrinfListNode(h);
break;
case 2:
printf("請寫出成員的位置:");
scanf("%d",&i);
printf("請輸入學生姓名:");
scanf("%s",&name);
printf("請輸入學生分數:");
scanf("%d",&score);
h->InsertList(h,i,name,score,&n);
printf("表中成員為:\n");
h->PrinfListNode(h);
break;
case 3:
printf("請寫出成員的位置:");
scanf("%d",&i);
h->DeleteList(h,i,&n);
cout<<"表中成員為:\n";
h->PrinfListNode(h);
break;
case 4:
printf("表中成員為:\n");
h->PrinfListNode(h);
break;
case 5:
printf("請輸入另一個表中成員的個數:\n");
scanf("%d",&n);
k=k->CreateNode(n);
h=h->operator +=(k);
printf("兩個鏈表相加之後的鏈表是:\n");
h->PrinfListNode(h);
break;
case 6:
h=h->Unique(h,&n);
printf("剔除重復元素後的新鏈表是:\n");
h->PrinfListNode(h);
break;
case 0:
return 0;
break;
default:
printf("出錯啦!請重試!");
}
}
return 0;
}
void DisplayNote(void)
{
printf("1--建立新的鏈表\n");
printf("2--添加元素\n");
printf("3--刪除元素\n");
printf("4--輸出當前鏈表中的內容\n");
printf("5--兩個鏈表對象合並\n");
printf("6--剔除鏈表中重復元素\n");
printf("0--退出\n");
}
⑶ 學生成績管理系統: C++課程設計,設計主要功能:能按學期、按班級完成對學生成績的錄入、修改; 能按班級
去論壇上下一個吧,這種題目估計一搜一大片
⑷ 急求!!!!!一個用MATLAB設計的學生成績管理系統程序(程序每句都需要加註釋)
就是單抄鏈表定義結構體STUDENT,可襲包括學生姓名,學號,各科成績,總分等信息,外加一個指向結構體類型的指針next,建立單鏈表,然後根據要求編寫一系列函數,例如刪除,插入,修改等,在主函數中調用用這種方法的好處就是在刪除、插入信息時比較方便,只需要改變next的指向就好,不需要移動,而如果用數組的話,在刪除插入時就要移動一堆的數據,編起來很麻煩啊~這個就是單鏈表的好處啊~
⑸ matlab 學生成績管理系統
#include <iostream>
#define number 100
#define increasment 10
using namespace std;
int i;
bool found;
//結構體變數student.
struct student
{
char num[4];//學生的學號.
int score;//學生的分數.
};
//定義線性表變數.
typedef struct
{
student *elem;//線性表的首地址.
int length;
int listsize;
}sqlist;
//初始化此表.
void initlist(sqlist &L)
{
L.elem=(student*)malloc(number*sizeof(student));//分配存儲空間.
if(!L.elem)exit(0);
L.length=0;
L.listsize=number;
return;
}
//為次表添加數據.
void inputlist(sqlist &L)
{
int n;
cout<<"輸入你要存入學生信息的個數n:"<<endl;
cin>>n;
if(n>L.listsize)cout<<"空間不足.";//如輸入的個數大於表的初始長的報錯.
cout<<"這"<<n<<"明學生的具體的信息(學號(三位),成績)是:"<<endl;
cout<<"輸入範例:"<<endl<<"001 97"<<endl<<"002 95"<<endl<<"......"<<endl<<"學號 成績"<<endl;
for(i=0;i<n;i++)
{
buf:
cin>>L.elem[i].num>>L.elem[i].score;//輸入學生的學號和成績.
if(L.elem[i].score<0||L.elem[i].score>100)//判斷如果數據是否符合要求.
{
cout<<"輸入數據錯誤,請從新輸入"<<endl;
goto buf;
}
L.length++;
}
}
//輸出整個表.
void output(sqlist &L)
{
cout<<"學號 成績"<<endl;
for(i=0;i<L.length;i++)//輸出表中所有學生的信息.
cout<<L.elem[i].num<<" "<<L.elem[i].score<<endl;
cout<<"學生總個數為:"<<L.length<<endl;
return ;
}
//在表中的某個位置插入一個元素.
void insertlist(sqlist &L,int i,student &e)
{
student *q,*newbase;
if(i<1||i>L.length+1)//如果插入的位置超出范圍則報錯.
printf("插入的節點不存在./n");
if(L.length>=L.listsize)
{
newbase=(student*)realloc(L.elem,(number+increasment)*sizeof(student));//開辟內存.
if(!newbase)exit(0);
L.elem=newbase;
L.listsize+=increasment;
}
for(q=L.elem+L.length-1;q>=&(L.elem[i-1]);q--)//插入點數之後的數據進行後移.
*(q+1)=*q;
*(q+1)=e;//插入該點.
L.length++;//表長加1.
output(L);//輸出插入元素後所有學生的信息.
return ;
}
//刪除一個一個表中的某個元素.
void deletelist(sqlist &L,int i,student &e)
{
student *p;
if(i<1||i>L.length)//刪除的點超出范圍則報錯.
printf("刪除的節點不存在./n");
e=L.elem[i-1];
for(p=&(L.elem[i-1]);p<=L.elem+L.length-2;p++)//刪除點之後的元素進行前移.
*p=*(p+1);
L.length--;//表長減1.
output(L);//輸出刪除元素後所有學生的信息.
return ;
}
//合並兩個表.
void connect(sqlist &La,sqlist &Lb,sqlist Lc)
{
student *pa,*pb,*pc,*pa_last,*pb_last;
pa=La.elem;pb=Lb.elem;
Lc.listsize=Lc.length=La.length+Lb.length;
pc=Lc.elem=(student*)malloc(Lc.listsize*sizeof(student));//分配新內存.
if(!pc)exit(0);
pa_last=La.elem+La.length-1;
pb_last=Lb.elem+Lb.length-1;
while(pa<pa_last&&pb<pb_last)//將表La和表Lb中的元素進行比較後添加到表Lc中.
{
if((*pa).score<(*pb).score)*pc++=*pa++;
else*pc++=*pb++;
}
while(pa<=pa_last)*pc++=*pa++;//將還剩下的元素也添加到表Lc中去.
while(pb<=pb_last)*pc++=*pb++;
output(Lc);//輸出表Lc.
return ;
}
//定位某個元素是否在此線性表中.
bool location(sqlist &L,student &e)
{
found=false;
for(i=0;i<L.length&&!found;i++)//尋找元素是否在表中.
{
found=false;
for(int j=0;j<3;j++)
{
found=false;
if(e.num[j]==L.elem[i].num[j]&&e.score==L.elem[i].score)//存在則found賦值為true.
found=true;
}
}
return found;//返回一個bool型變數,來判斷是否找到元素.
}
int main()
{
int n;//作為選擇變數.
sqlist La,Lb,Lc;//定義三個表.
student e;//定義學生變數.
initlist(La);//初始化表La.
inputlist(La);//對表La進行賦值.
repeat:
cout<<"你可以對這些學生進行如下操作:"<<endl<<"1:插入元素;2:刪除元素;3:顯示所有信息;4:合並兩個表;5:查找某元素是否在表中."<<endl;
cin>>n;
switch(n)//選擇要進行的操作.
{
case 1:
{
cout<<"請輸入所插入元素在哪個元素前.";
cin>>i;
cout<<"請輸入所插入學生的具體信息,即學號(三位數字):";//輸入學生的學號.
cin>>e.num;
cout<<"請輸入成績(0-100):";//數入學生的成績.
cin>>e.score;
insertlist(La,i,e);break;//將上面的元素插入到表中去.
}
case 2:
{
cout<<"請輸入所要刪除的元素.";
cin>>i;
deletelist(La,i,e);break;//刪除表的此元素.
}
case 3:output(La);break;//輸出表.
case 4:
{
cout<<"請再建立一個表,從而能夠實現兩個表的合並."<<endl;
initlist(Lb);//初始化表Lb.
inputlist(Lb);//對表Lb進行賦值.
cout<<endl;
connect(La,Lb,Lc);break;//合並表La和Lb,並存到表Lc中.
}
case 5:
{
cout<<"請輸入所要查找學生的具體信息,即學號(三位數字):";//輸入學生的學號.
cin>>e.num;
cout<<"請輸入成績(0-100):";//數入學生的成績.
cin>>e.score;
if(location(La,e))//確定此元素是否存在.
cout<<"此學生在表中,基本信息是:"<<e.num<<" "<<e.score<<endl;
else
cout<<"此學生不在表中."<<endl;
break;
}
default:cout<<"error";break;//報錯.
}
cout<<"是否還進行其它操作,是請按1,否請按2."<<endl;
cin>>i;
if(i==1)//判斷是否還進行其它的操作.
goto repeat;//是在跳到repeat出.
return 0;
}
⑹ matlab gui編程學生成績管理系統,求參考文件。
學生刪除和信息修改 就沒有做了 後面的要求都有 不知道要不要參考下??
⑺ vb學生成績管理系統(課程設計)
加我,馬上解決
⑻ 設計一個簡單的學生成績管理系統,
我沒寫,只能和你說說怎麼寫。
可以由類模板和數組寫。
我說說類模板的吧。
定義一個Student類存放學生信息(姓名,初始排名,各科成績,個人總分);
初始排名由輸入順序排,在計算名字的時候就可以通過冒泡排序。
在裡面定義計算總分的函數。
下面定義一個Caozuo類,用學生鏈表的做。你可以去找下這個例子。
數組的就很簡單了,你只要想想。先定義數組(姓名,成績),總分就是個人每科成績的和,下面5個函數都可以通過數組遍歷實現。如
cout<<"請輸入你要查詢的學生的名字:"<<endl;
cin>>n;
for(int i=0;i<=Maxsize;i++)
{
if(Student[i].name==n)
Student[i].Print();
}
⑼ 求一個學生成績管理系統課設
用什麼語言做?我有asp的學生信息管理系統,裡面有學生成績管理的模塊。剛剛畢設做完的,可運行