程式設計任務 簡單的學生資訊管理系統

2021-08-14 19:11:49 字數 4750 閱讀 8422

因為時間有限所以只簡單的寫了一下,若有不對的地方,敬請各位指正.

標頭檔案 stu.h

#ifndef codedefine_h

#define codedefine_h

#includeusing namespace std;

class student;

bool operator< (const student& a,const student& b);

class mainsystem;

#endif

made.cpp

#include"stu.h"

#include#include#include#include#include#includeusing namespace std;

bool operator < (const student& a,const student& b)

bool operator == (const student& a,const student& b)

student::student(){}

student::student(char *n,char *id1,char s,double g,double e,double m,double com,double cl)

*** = s;

graphics = g;

english = e;

math = m;

computer = com;

clanguage = cl;

totgrade = g+e+m+com+cl;

next = null;

}//拷貝構造

student::student(student &s)

*** = s.get***();

graphics = s.getgraphics();

english = s.getenglish();

math = s.getmath();

computer = s.getcomputer();

clanguage = s.getclanguage();

totgrade = s.gettotgrades();

}char const* student::getname() const

char const* student::getid() const

char student::get***() const

double student::getgraphics() const

double student::getmath() const

double student::getenglish() const

double student::getcomputer() const

double student::getclanguage() const

double student::gettotgrades() const

//change student imformation

void student::setname()

void student::set***()

void student::setgrades()

void student::changestuinfor()

void student::showinfor()

f.close();

}//根據學號順序顯示學生資訊

void mainsystem::showstuinfor()

cout<<"\n"next->getgraphics() ) ? p[0] : temp->next->getgraphics();

p[1] = ( p[1] > temp->next->getenglish() ) ? p[1] : temp->next->getenglish();

p[2] = ( p[2] > temp->next->getmath() ) ? p[2] : temp->next->getmath();

p[3] = ( p[3] > temp->next->getcomputer() ) ? p[3] : temp->next->getcomputer();

p[4] = ( p[4] > temp->next->getclanguage() ) ? p[4] : temp->next->getclanguage();

p[5] = ( p[5] > temp->next->gettotgrades() ) ? p[5] : temp->next->gettotgrades();

grade[i++] = temp->next->gettotgrades();

temp = temp->next;

} double r;//用於去重,如果分數重複的話可以去掉

int rank = 1;//排名計數器

cout<<"排名統計:"<= 0)

r = grade[i];

} //顯示物理最高分

temp = head;

cout<<"\n物理最高分:"getgraphics() == p[0])

coutgetname()getid()

get***()} //顯示英語最高分

temp = head;

cout<<"\n英語最高分:"getenglish() == p[1])

coutgetname()getid()

get***()} //顯示數學最高分

temp = head;

cout<<"\n數學最高分:"getmath() == p[2])

coutgetname()getid()

get***()} //顯示計導最高分

temp = head;

cout<<"\n計導最高分:"getcomputer() == p[3])

coutgetname()getid()

get***()} //顯示c語言最高分

temp = head;

cout<<"\nc語言最高分:"getclanguage() == p[4])

coutgetname()getid()

get***()} system("pause");

}//儲存所有學生資訊

void mainsystem::keepinfor()

}//刪除學生資訊

void mainsystem::deletestuinfor()

temp->next = temp->next->next;

delete del;

keepinfor();

cout<<"\t\t刪除成功\n";

size--;

return;}}

temp = temp ->next;

} cout<<"\t\t未找到該學生資訊"<>name;

cout<<"\t\t學號:"; cin>>id;

cout<<"\t\t性別(男:1,女:2):"; cin>>***;

cout<<"\t\t物理:"; cin>>graphics;

cout<<"\t\t英語:"; cin>>english;

cout<<"\t\t數學:"; cin>>math;

cout<<"\t\t計算機導論:"; cin>>computer;

cout<<"\t\tc語言:"; cin>>clanguage;

student* p = new student(name,id,***,graphics,english,math,computer,clanguage);

p->showinfor();

cout<<"\t\t確認儲存?(y/n)";

char a;

cin>>a;

if(a == 'y'||a =='y')

if(temp == tail)

p->next = temp->next;

temp->next = p;

keepinfor();

cout<<"\t\t新增成功";

size++; }}

void mainsystem::searchstuinfor()

}//根據學生的學號尋找學生資訊

void mainsystem::searchstuwithid()

temp = temp->next;

} if(!key) cout<<"not found!"<>name;

while(temp != tail)

temp = temp->next;

} if(!key) cout<<"not found!"<>id;

while(temp != tail )

case '2':

case '3':

case '4':

default: ;

}} temp = temp->next;

} cout<<"\t\tnot found\n\t\t";

system("pause");

}/*顯示選單

輸入可能需要放進主函式中...不然每次無用的輸入可能會導致重新整理

*/void mainsystem::menu()

system("cls");

} return 0;

}

//@author: lovelytotoro

學生資訊管理系統(Windows程式設計)

其實我覺的學校作業可以稍微少花點時間,把時間放到自己認為重要的地方去。其實我覺的直接連資料庫也是很方便的,你們可以嘗試下 別嘗試xml了,對身體不好 我的xml放在debug檔案下,我們先看下xml檔案內容 node代表乙個節點,裡面id,name,address都是一些內容可以根據自己的需要進行,...

學生資訊管理系統

學生資訊管理系統,顧名思義就是為了管理學生的相關資訊做的一款軟體。雖然這次有原始碼供我們參考,但是從中我學習到了如何從開始到完工去做一款軟體,下邊我從做一項軟體專案的前後順序來總結我的學生資訊管理系統。一,分析需求 首先在做這款軟體是,我們先想象乙個成品,他的功能有哪些,每個功能完成哪項任務,這就是...

學生資訊管理系統

1.背景描述 學校招生辦在錄取當年新生時為新生建立了乙個新生基礎資訊類studentbase,其中包含每位新生的基本資料 學號 long mnum 姓名 char mname 20 性別 int m 其中0表示男,1表示女 年齡 int mage 住址 char maddr 30 新生主修專業所在系...