學生成績管理系統20
Ⅰ 基於java設計一個學生成績管理系統,要求有界面,且有增加,查詢,修改,刪除,退出功能,代碼如何寫
我給你一些參考資料,希望會對你有用
學員管理系統數據報表
數據名稱(StudentManager)
用戶信息表(UserInfo)
欄位 類型 說明 大小 是否為空
UserName(主鍵) varchar 學員姓名 20 NOT NULL
PassWord varchar 密碼 20 NOT NULL
Power int 許可權 4 NOT NULL
課程信息表(CourseInfo)
欄位 類型 說明 大小 是否為空
CourseID(主鍵) int 課程編號 4 NOT NULL
CourseName varchar 課程名稱 20 NOT NULL
SpecialtyID int 專業編號 4 NOT NULL
學員基本信息表(StuInfo)
欄位 類型 說明 大小 是否為空
StuID(主鍵) varchar 學號 20 NOT NULL
StuName varchar 姓名 20 NOT NULL
Sex char 性別 10 NOT NULL
Birthday varchar 出生日期 20 IS NULL
NativePlace varchar 籍貫 20 IS NULL
SchoolAge varchar 學歷 20 IS NULL
Address varchar 地址 100 IS NULL
Postcode varchar 郵政編碼 20 IS NULL
Tel varchar 聯系方式 20 IS NULL
Remark varchar 備注 100 IS NULL
ClassID int 班級編號 4 NOT NULL
成績信息表(GradeInfo)
欄位 類型 說明 大小 是否為空
StuID varchar 學號 20 NOT NULL
CourseID int 課程編號 4 NOT NULL
Grade varchar 成績 20 IS NULL
班級信息表(ClassInfo)
欄位 類型 說明 大小 是否為空
ClassID(主鍵) Int 班級編號 4 NOT NULL
ClassName varchar 班級名稱 20 NOT NULL
Sort varchar 班級類別 20 NOT NULL
Number int 班級人數 4 IS NULL
Teacher varchar 輔導員 20 IS NULL
SpecialtyID int 專業編號 IS NOT NULL
專業信息表(SpecialtyInfo)
欄位 類型 說明 大小 是否為空
SpecialtyID(主鍵) int 專業編號 4 NOT NULL
SpecialtyName varchar 專業名稱 20 NOT NULL
四、 系統功能模塊:
菜單欄:操作、管理、工具、幫助。
操作:
修改密碼;
切換用戶;
退出系統。
管理:
用戶管理:添加用戶、刪除用戶;
學員管理:添加學員、刪除學員、修改學員、
移動學員;
專業管理:添加專業、刪除專業、修改專業;
課程管理:添加課程、刪除課程、修改課程;
班級管理:添加班級、刪除班級、修改班級;
成績管理:添加成績、刪除成績、修改成績。
工具:
查看成績;
輔助工具:計算器、記事本。
幫助:
幫助說明;
版本信息;
關於我們。
快捷工具欄:添加學員、刪除學員、修改學員、移動學員、
查看成績、輔助工具。
五、 系統數據模塊:
系統用戶信息:用戶名、密碼、用戶許可權;
學員基本信息:學號、姓名、性別、出生年月、籍貫、學歷、
住址、郵政編碼、聯系方式、備注、班級編號;
專業信息:專業編號、專業名稱;
課程信息:課程編號、課程名稱、專業編號;
班級信息:班級編號、班級名稱、班級類別、班級人數、
輔導員、專業編號;
成績信息:學號、課程編號、成績;
Ⅱ 跪求mfc的學生成績管理系統,簡單的增刪改查就行,資料庫是ACCESS,小弟就20財富,全給大家了.
給你傳了一個壓縮的,裡面有兩個系統都是,有一個csdn程序員網站 要注冊 那裡有很多!以後可以自己找了!
Ⅲ 管理信息系統實驗報告
實驗目的: 學習LMIS的設計方法和思想
實驗內容: 1、能從GIS平台進行設計軟體,網路平台
2、選擇你最熟悉的業務畫功能圖
3、畫頁面設計
4、編碼模型設計
5、選擇模塊設計
實驗過程:
1. 學生信息管理系統功能結構圖
根據系統分析階段得到的數據流圖,採用軟體設計的概念和原理,以上一次參照的學生信息管理信息系統為實例,給出學生信息管理系統功能結構圖(圖1.1)。
2.系統運行平台設計
2.1系統運行平台設計的依據與基本原則
系統運行平台是指管理信息系統運行所依賴的硬體和軟體,因此其設計就是針對新系統的目標,在各種技術手段和實施方法中權衡利弊,合理地利用各種資源,選擇適當的計算機硬體,網路通信設備及其他輔助設備,軟體,以滿足新系統邏輯模型的需要和技術需求。系統運行平台設計的內容主要包括系統網路配置,硬體平台選擇,軟體平台選擇等。系統運行平台設計是每一個企業在開發管理系統時都要遇到的問題,影響著整個系統的成敗。
操作系統的選擇可以選擇Window NT、Windows 2000 Server、Windows Server 2003
2.2系統平台設計方案
本系統採用Windows NT 4.0作為網路操作系統,後台資料庫管理採用Microsoft Access,採用PowerBuilder 8.0作為前台卡發工具,採用C/S計算模式,資料庫伺服器設置在信息中心。
學生檔案管理系統
系統
學籍管理
班級管理
專業與課程
成績管理
圖1.1 學生信息管理系統功能圖
3.代碼設計
為了方便學生的管理,方便數據的輸入和輸出,為每個學生編制了學號代碼。左起兩位代表入學時間,左起3~4為表示招生類型,左起5~6位表示所屬院系,7~8表示所屬專業,後兩位表示學生序號(圖4.1)。
N N N N N N N N N N
學生序號
所屬專業
所屬院系
招生類型
入學時間
圖4.1 代碼設計圖
例如,學號0307241081表示此學生為2003年入學,二級學院經濟管理學院信息管理與信息系統專業序號為81號
4.資料庫設計
4.1資料庫的邏輯
在完成數據的概念模型設計即E-R圖後,即可進入資料庫的邏輯設計階段。資料庫的邏輯設計即把得到的滿足第三範式的關系轉化為特定的資料庫管理系統下的數據表。根據前面得到的各個關系,現把它們轉化為數據表。
(1)學生信息表:學號、姓名、性別、政治面貌、出生日期、專業、班級、家庭住址、聯系電話、備注。此表共有10個欄位,由於在校所有學生中,不可能存在兩個學生的學號相同,所以在本表中學號作為學生信息表的主鍵。
(2) 課程信息表:課程名稱、所屬專業。
(3)專業信息表:專業編號、專業名稱。此表以專業編號為主鍵。
(4) 班級信息表:班級名稱、所屬院系、輔導員、教室、人數。此表共有5個欄位,以班級名稱為主鍵,用於記錄學生所在班級的信息。
(5) 成績信息表:學號、姓名、專業、課程名稱、成績。此表共有5個欄位,以學號和課程名稱共同為主鍵,用於記錄學生在校期間的各科考試成績。
(6) 用戶表:用戶名稱、密碼、用戶ID。此表用於系統對操作員的設置。
4.2 資料庫的物理設計
在完成資料庫的邏輯設計後,就可以開始資料庫的物理設計。本學生信息管理系統採用Access資料庫。並在以下創建幾個數據表,其結構如下:
表5.2.1 學生信息表結構
欄位名
數據類型
欄位長度與格式
關鍵字
學號
文本
15
是
姓名
文本
20
否
性別
文本
5
否
政治面貌
文本
12
否
出生日期
日期型
YYYY-MM-DD
否
專業
文本
20
否
班級
文本
20
否
家庭住址
文本
50
否
聯系電話
文本
15
否
備注
文本
50
否
表5.2.2 課程信息表結構
欄位名
數據類型
欄位長度與格式
關鍵字
課程名稱
文本
20
是
所屬專業
文本
20
否
表5.2.3 專業信息表結構
欄位名
數據類型
欄位長度與格式
關鍵字
班級名稱
文本
20
是
所屬院系
文本
20
否
輔導員
文本
10
否
教室
文本
15
否
人數
文本
3
否
表5.2.4 班級信息表結構
欄位名
數據類型
欄位長度與格式
關鍵字
專業名稱
文本
20
是
所屬院系
文本
20
否
表5.2.5 成績信息表結構
欄位名
數據類型
欄位長度與格式
關鍵字
學號
文本
15
是
姓名
文本
20
否
成績專業
文本
20
否
課程名稱
文本
20
是
成績
文本
5
否
5. 模塊設計
採用SD法和模塊說明數,完成系統模塊設計。圖5.1給出了系統「班級管理」
表5.2為其模塊說明書。
班級管理
添加班級
修改班級
修改班級信息成功
出錯信息
圖5.1「班級管理」結構圖
表5.2 「班級管理」模塊的描述
模塊編號
F-bjgl
名稱
班級管理
功能
對班級進行添加和修改
輸入
專業名,所屬院系
輸出
0:操作失敗;1:操作成功
相關表
班級信息表
調用的模塊
班級添加;班級修改
實驗收獲:
通過在上機的實驗過程的操作中,認識到並且了解到了系統分析與系統設計過程中從物理模型上到概念模型上的轉換的實現。同時也學習了在數據設計過程中的一些比較重要的和關鍵的步驟與信息。在製作實驗報告的過程中通過操作WORD進行作圖分析的過程,也加深了對系統設計過程的理解
自己修改一下就得了。
Ⅳ 學生成績管理系統c語言編輯的畢業設計 〔20分〕
#include <stdio.h>
#include <stdlib.h>
#include<string.h>
#define MENU_NUM 7
#define N 3
typedef struct s1
{
char no[11]; /*學號由10個字元組成*/
char name[15]; /*學生姓名*/
float score[N]; /*各門課成績*/
float sum; /*總分*/
float average; /*平均分*/
int order; /*名次*/
struct s1 *next; /*指向後繼結點的指針*/
}STUDENT; /*定義結構體類型*/
STUDENT * head=NULL;
void InputData( STUDENT * ptr );
void PrintMenu( );
int Menu_Select( );
void Init( );
void create( );
void print( ) ;
void Delete( );
void append();
void computer();
main()
{
int key;
while(1) {
key=Menu_Select();
switch(key)
{
case 0: Init();
//初試化鏈表。也就是若鏈表不為空則釋放鏈表中所有數據,將head置為空(NULL)
break;
case 1: create();
//創建鏈表,輸入數據
break;
case 2: Delete();
//刪除一個指定學號的記錄數據
break;
case 3: print();
//列印鏈表中所有數據
break;
case 4: computer();
//計算鏈表中所有人的總分和平均分
break;
case 5: append();
//追加一個數據到鏈表的尾部
break;
case 6: Init();
//釋放鏈表
exit(0);
}
};
}
void PrintMenu( )
{
int i;
char * menu[]={
"0. Init list",
"1. Enter list",
"2. Delete a record from list",
"3. Print list",
"4. Compute the score",
"5. Insert record to list",
"6. Quit"
};
printf("\n\n");
for (i=0;i<MENU_NUM;i++)
printf("%s\n",menu[i]);
printf("\nEnter your choice(0-6):");
}
int Menu_Select( )
{
int key;
PrintMenu( );
scanf("%d",&key);
return key;
}
void Init( ) //初始化單鏈表。也就是釋放鏈表中的所有數據
{
STUDENT *p,*ptr;//定義兩個臨時指針變數p,ptr
p=head;ptr=head;//將兩個臨時變數指向頭指針head ;
while(ptr!=NULL)
{
ptr=ptr->next;//ptr指向下一個結構數據
free(p);//釋放p所指向的結構數據的內存
p=ptr;//將p指向ptr所指向的數據
}
head=NULL;//將head指向NULL
}
void create( ) //創建單鏈表
{
STUDENT *pt, *pth=NULL; //定義兩個指針變數:pt指向即將申請新的數據內存,pth指向當前數據
while(1)
{
pt=(STUDENT *)malloc(sizeof(STUDENT));//讓pt指向新申請的內存空間
InputData(pt);//輸入數據,存放到pt所指向的結構數據。注意讓pt的next指向NULL
if (strcmp(pt->no,"@")==0)
{
free(pt);//釋放pt所指向的內存空間
break;//退出循環
}
else if (head==NULL)
{
pth=pt;
head=pt;//將頭指針head和pth指向pt
}
else
{
pth->next=pt; //將pth的next指向pt;
pth=pt; //將pth指向pt;
}
};
}
void print( ) //列印單鏈表中所有數據
{ int i=0;
STUDENT *p;//第一個指針p
p=head;//將p指向head
printf("\n");
printf("******************************STUDENT******************************\n");
printf("|rec|no | name | sc1| sc2| sc3| sum | ave |order|\n");
printf("|---|----------|----------------|----|----|----|------|-----|-----|\n");
//列印表頭
while (p!=NULL)
{
printf("|%3d|%10s|%-16s|%4.1f|%4.1f|%4.1f|%6.2f|%5.1f|%5d|\n",
++i,p->no,p->name,p->score[0],p->score[1],p->score[2],
p->sum,p->average,p->order); //列印p所指向的結構中的所有數據。注意列印數據間的分隔線
p=p->next;//將p指向p的下一個結構數據
}
printf("********************************END********************************\n");//列印表尾
}
void Delete( ) //刪除一個記錄
{
STUDENT *p,*pth;//定義兩個指針p,pth
char no[11];//定義一個整數no(用來存儲輸入的學號)
printf("intput delete no\n");
scanf("%s",no);//用輸入語句輸入一個學號存儲到no中
p=head;pth=head;//將p和pth都指向頭指針
if (strcmp(p->no,no)==0) //也就是若頭指針指向的數據需要刪除
{
head=head->next;//將head指針指向head的下一個數據;
free(p);//釋放p所指向的數據
}
else
{
p=p->next;//將p指向p的下一個數據
while ( p!=NULL)
{
if (strcmp(p->no,no)==0) //找到了要刪除的數據
{
pth->next=p->next;//將pth的next指向p的next
free(p);//釋放p
break;//退出循環
}
else
{
pth=pth->next;//將pth指向pth的next 或 將pth指向p
p=p->next;//將p指向p的next
}
}
}
}
void append()
{
STUDENT *p,*pth;//定義兩個指針變數p,pth
pth=head;//將pth指向head
while ( pth->next!=NULL)
{
pth=pth->next;//ptr指向ptr的next
}
p=(STUDENT *)malloc(sizeof(STUDENT));//將p指向新申請的內存空間
InputData(p);p->next=NULL;//數據數據存儲到p所指向的內存空間,注意將p的next置為NULL
pth->next=p;//將ptr的next指向p
}
void InputData( STUDENT *ptr )
{ int i;
printf("enter no:");
scanf("%s",ptr->no);
if (strcmp(ptr->no,"@")==0 ) return;
printf("enter name:");
scanf("%s",ptr->name);
for(i=0;i<3;i++)
{
printf("shuru chengji\n");
scanf("%f",&ptr->score[i]);
}
ptr->sum=0;
ptr->average=0;
ptr->order=0;
ptr->next=NULL;
}
void computer()
{
STUDENT *p;
p=head;
for(;p;p=p->next)
{
p->sum=p->score[0]+p->score[1]+p->score[2];
p->average=(p->score[0]+p->score[1]+p->score[2])/3;
}
}
Ⅳ 成績管理系統 完成下列功能: 1、輸入:函數input把20學生的學號、姓名、性別、年齡、四科成績
你確定這是java?
我怎麼感覺有點像c或者c++啊?
假如是java做,我可以教教你。
Ⅵ 假設收集到了一個班學生的所有成績信息(不低於20人),要求用C語言編寫一個簡單的成績管理系統
代碼已發,在附件,郵件名「代碼」,附件Untitled2.c
如果有疑問歡迎追問。
代碼如下:
#include<stdio.h>
#include<string.h>
#include<malloc.h>
#include<math.h>
#define min(A,B) (A<B?A:B)
#define max(A,B) (A<B?B:A)
typedef struct Student
{
long long int id;
char name[11];
int score[4];
double avg;
struct Student* next;
} Student;
void print(Student* stu)
{
printf("學號:%10lld 姓名:%10s 成績:語文:%3d 數學:%3d 英語:%3d 計算機:%3d 平均分:%3.2lf ",
stu->id,stu->name,stu->score[0],stu->score[1],stu->score[2],stu->score[3],stu->avg);
}
int main(void)
{
Student* head = 0;
int stucount=0;//數量
while(1)
{
printf("輸入操作號:1:錄入學生 2:瀏覽 3:查詢 4:修改 5:排序 6:統計 ");
int quest;
scanf("%d",&quest);
scanf("%*[^ ]");
if(quest==1)
{
printf("錄入學生: ") ;
while(1)
{
printf("請輸入學生學號(-1退出錄入): ");
long long int id;
scanf("%lld", &id);
if(id==-1)break;
Student* newStudent = (Student*)malloc(sizeof(Student));
newStudent->id=id;
printf("請輸入學生名字: ");
scanf("%10s", newStudent->name);
scanf("%*[^ ]");
printf("請輸入學生語文成績: ");
scanf("%d",&(newStudent->score[0]));
printf("請輸入學生數學成績: ");
scanf("%d",&(newStudent->score[1]));
printf("請輸入學生英語成績: ");
scanf("%d",&(newStudent->score[2]));
printf("請輸入學生計算機成績: ");
scanf("%d",&(newStudent->score[3]));
int sum=0;
for(int i=0; i<4; ++i)sum+=newStudent->score[i];
newStudent->avg = sum/4.0;
printf("學生已錄入!平均分為:%lf ",newStudent->avg);
//插入鏈表首,這樣最新添加的顯示在最上面,容易看見效果
newStudent->next=head;
head=newStudent;
++stucount;
}
}
else if(quest==2)
{
if(head==0)
printf("沒有學生! ");
else
{
printf("開始瀏覽學生: ");
int st=0,en=min(st+10,stucount);
while(1)
{
printf("瀏覽學生:%d個到%d個學生 ",st+1,en);
Student* stu = head;
for(int i=0; i<st; ++i)
{
stu=stu->next;
}
for(int i=st; i<en; ++i)
{
print(stu);
stu=stu->next;
}
printf("輸入操作號:1 向後翻頁;2 向前翻頁;-1 退出 ");
int squest;
scanf("%d",&squest);
scanf("%*[^ ]");
if(squest==1)
{
if(en!=stucount) st=en;
}
else if(squest==2)
{
st=max(0,st-10);
}
else if(squest==-1)break;
en=min(st+10,stucount);
}
}
}
else if(quest==3)
{
printf("開始查詢學生信息: ");
while(1)
{
printf("通過什麼查詢?1:學生id 2:學生名字 3:學生語文成績 4:學生數學成績 5:學生英語成績 6:學生計算機成績 7:平均分 -1 退出 ");
int squery,squery2;
scanf("%d", &squery);
if(squery==-1)break;
Student temp;
Student* newStudent = &temp;
if(squery==1)
{
printf("請輸入學生id: ");
scanf("%lld", &(newStudent->id));
}
else if(squery==2)
{
printf("請輸入學生名字: ");
scanf("%10s", newStudent->name);
scanf("%*[^ ]");
}
else if(squery==3)
{
printf("請輸入學生語文成績: ");
scanf("%d",&(newStudent->score[0]));
}
else if(squery==4)
{
printf("請輸入學生數學成績: ");
scanf("%d",&(newStudent->score[1]));
}
else if(squery==5)
{
printf("請輸入學生英語成績: ");
scanf("%d",&(newStudent->score[2]));
}
else if(squery==6)
{
printf("請輸入學生計算機成績: ");
scanf("%d",&(newStudent->score[3]));
}
else if(squery==7)
{
printf("請輸入學生平均分: ");
scanf("%lf",&(newStudent->avg));
}
if(squery>=3 && squery<=7)
{
printf("顯示比此分數高還是低的學生?1:低 2:高 ");
scanf("%d",&squery2);
}
Student* stu = head;
int flag=0;
while(stu!=0)
{
if(squery==1)
{
if(newStudent->id==stu->id)
{
print(stu);
flag=1;
}
}
else if(squery==2)
{
if(strcmp(newStudent->name,stu->name)==0)
{
print(stu);
flag=1;
}
}
else if(squery==7)
{
if((newStudent->avg!=stu->avg) && ((newStudent->avg>stu->avg) ^ (squery2==2)))
{
print(stu);
flag=1;
}
}
else if(squery>2 && squery<7)
{
if((newStudent->score[squery-3]!=stu->score[squery-3]) && ((newStudent->score[squery-3]>stu->score[squery-3]) ^ (squery2==2)))
{
print(stu);
flag=1;
}
}
stu=stu->next;
}
if(flag==0)
{
printf("沒有查到學生! ");
continue;
}
}
}
else if(quest==4)
{
printf("開始修改學生信息: ");
while(1)
{
printf("請輸入學生學號(-1退出修改): ");
long long int id;
scanf("%lld", &id);
if(id==-1)break;
Student* newStudent = head;
Student* lststu = 0;
while(newStudent!=0 && newStudent->id!=id)
{
lststu=newStudent;
newStudent=newStudent->next;
}
if(newStudent==0)
{
printf("沒有查到學生! ");
continue;
}
printf("請輸入操作號:1:修改學生名字 2:修改學生語文成績 3:修改學生數學成績 4:修改學生英語成績 5:修改學生計算機成績 6:刪除學生 ");
int squery;
scanf("%d", &squery);
if(squery==1)
{
printf("請輸入學生名字: ");
scanf("%10s", newStudent->name);
scanf("%*[^ ]");
}
else if(squery==2)
{
printf("請輸入學生語文成績: ");
scanf("%d",&(newStudent->score[0]));
}
else if(squery==3)
{
printf("請輸入學生數學成績: ");
scanf("%d",&(newStudent->score[1]));
}
else if(squery==4)
{
printf("請輸入學生英語成績: ");
scanf("%d",&(newStudent->score[2]));
}
else if(squery==5)
{
printf("請輸入學生計算機成績: ");
scanf("%d",&(newStudent->score[3]));
}
else if(squery==6)
{
stucount--;
if(lststu!=0)
lststu -> next = newStudent -> next;
else
head = newStudent -> next;
printf("已刪除學生! ");
}
if(squery!=6)
{
int sum=0;
for(int i=0; i<4; ++i)sum+=newStudent->score[i];
newStudent->avg = sum/4.0;
printf("學生已修改!他的平均分為:%lf ",newStudent->avg);
}
}
}
else if(quest==5)
{
if(head==0)
printf("沒有學生! ");
else
{
printf("對學生按什麼排序?:1:學生號 2:名字 3:語文成績 4:數學成績 5:修改學生英語成績 5:計算機成績 6:平均分 ");
int squery;
scanf("%d", &squery);
printf("升序還是降序? 1:升序 2:降序 ");
int squery2;
scanf("%d", &squery2);
int flag=1;
Student* stu = head;
Student* lststu = 0;
while(flag==1)
{
flag=0;
while(stu->next!=0)
{
int swflag=0;
if(squery==0)
{
if((stu->next->id > stu->id) ^ (squery2==1))swflag=1;
}
else if(squery==1)
{
if((strcmp(stu->next->name,stu->name)>0) ^ (squery2==1))swflag=1;
}
else if(squery==6)
{
if((stu->next->avg > stu->avg) ^ (squery2==1))swflag=1;
}
if(swflag==1)
{
flag=1;
if(lststu==0) head=stu->next;
else lststu->next=stu->next;
Student* temp = stu->next->next;
stu->next->next=stu;
stu->next=temp;
}
lststu=stu;
stu=stu->next;
}
}
printf("已排序! ");
}
}
else if(quest==6)
{
double totscore[4]= {0};
double sum=0;
Student* stu=head;
while(stu!=0)
{
for(int i=0; i<4; ++i)
{
totscore[i]+=stu->score[i];
sum+=stu->avg;
}
}
for(int i=0; i<4; ++i) totscore[i]=totscore[i]/4.0;
sum=sum/4.0;
printf("統計:學生人數:%d 語文平均分:%lf 數學平均分:%lf 英語平均分:%lf 計算機平均分:%lf 總平均分:%lf ",stucount,totscore[0],totscore[1],totscore[2],totscore[3],sum);
}
else if(quest==-1)
break;
}
return 0;
}
Ⅶ c++ 學生成績管理系統
這是我剛改過的代碼,還添加了求平均分的功能
#include<iostream.h>
#include<string.h>
#include<fstream.h>
class stu
{
char name[20];
int ba;
double math,number,chinese,english,average,sum;
public:
stu()
{
}
stu(char n[20],int ban,double nu,double ma,double chin,double eng)
{
strcpy(name,n);
ba=ban;
number=nu;
math=ma;
chinese=chin;
english=eng;
}
double getsum()
{
sum=chinese+english+math;
return sum;
}
double getaver()
{
average=getsum()/3;
return average;
}
friend void main();
};
void main()
{
cout<<"(0)數據錄入 (1)增加人員"<<endl;
cout<<"(2)刪除人員 (3)修改數據"<<endl;
cout<<"(4)按學號查詢 (5)按姓名查詢"<<endl;
cout<<"(6)輸出所有學生的數據 (7)按總分查詢排名"<<endl;
cout<<"(8)按語文查詢排名 (9)按數學查詢排名"<<endl;
cout<<"(y)按英語查詢排名 "<<endl;
cout<<"選擇相關操作請輸入相對的括弧里的阿拉伯數字或字母!"<<endl;
char p;char w;
stu *s[50];
ofstream *file[50];
int i=0;
int j=0;
bool flag2=0;
do
{
cin>>p;
if((p>='0'&&p<='9'))
flag2=1;
else
cout<<"指令錯誤!請重新輸入:"<<endl;
}while(flag2==0);
do{
switch(p)
{
case '0':
{
char c;
char name[20];int ba ;double number, math,chinese,english;
do{
cout<<"請輸入姓名"<<endl;
cin>>name;
cout<<"請輸入班級:"<<endl;
cin>>ba;
cout<<"請輸入您要增加的學生的學號:"<<endl;
cin>>number;
cout<<"請輸入數學成績:"<<endl;
cin>>math;
cout<<"請輸入語文成績:"<<endl;
cin>>chinese;
cout<<"請輸入外語成績:"<<endl;
cin>>english;
file[j]=new ofstream("d:\\document",ios::ate);
*file[j]<<"姓名"<<name<<"班級"<<ba<<"學號"<<number<<"數學成績"<<math<<"語文成績"<<chinese<<"外語成績"<<english<<endl;
j++;
s[i]=new stu(name,ba,number, math, chinese, english);
i++;
cout<<"數據錄入成功,想繼續錄入嗎(y/n)"<<endl;
cin>>c;
do
{
if(c!='y'&&c!='n')
{
cout<<"指令錯誤!請重新輸入!"<<endl;
cin>>c;
}
else
flag2=1;
}while(flag2==0);
}while(c=='y');
break;
}
case '1':
{
char name[20];int ba;double number,math,chinese,english;
char c;
do
{
cout<<"請輸入您要增加的學生的姓名:"<<endl;
cin>>name;
cout<<"請輸入要增加的學生的班級:"<<endl;
cin>>ba;
cout<<"請輸入您要增加的學生的學號:"<<endl;
cin>>number;
cout<<"請輸入數學成績:"<<endl;
cin>>math;
cout<<"請輸入語文成績:"<<endl;
cin>>chinese;
cout<<"請輸入外語成績:"<<endl;
cin>>english;
file[j]=new ofstream("d:\\document",ios::ate);
*file[j]<<"姓名"<<name<<"班級"<<ba<<"學號"<<number<<"數學成績"<<math<<"語文成績"<<chinese<<"外語成績"<<english<<endl;
j++;
s[i]=new stu(name, ba,number,math, chinese, english);
i++;
cout<<"數據錄入成功,想繼續錄入嗎(y/n)"<<endl;
cin>>c;
if(c!='y'&&c!='n')
{
cout<<"指令錯誤!請重新輸入!"<<endl;
cin>>c;
}
}while(c=='y');
break;
}
case '2':
{
char name[20];bool flag3=0;char c;
do{
cout<<"請輸入您要刪除的學生姓名:"<<endl;
cin>>name;
for(int h=0;h<i;h++)
{
if(strcmp(name,s[h]->name)==0)
{
flag3=1;
i--;
do{
s[h]=s[h+1];
h++;
}while(h<=i);
}
}
if(flag3==0)
cout<<"您要求刪除的對象本來就不存在!請檢查輸入的正確性!";
cout<<"要繼續刪除嗎?(y/n)"<<endl;
cin>>c;
if(c!='y'&&c!='n')
{
cout<<"指令錯誤!請重新輸入!"<<endl;
cin>>c;
}
}while(c=='y');
break;
}
case '3':
{
char name[20];double mat,chin,eng;flag2=0;
char c;
do
{
cout<<"請輸入您要修改的學生的姓名:"<<endl;
cin>>name;
for(int h=0;h<i;h++)
{
if(strcmp(name,s[h]->name)==0)
{
flag2=1;
cout<<"請輸入新的數學成績:"<<endl;
cin>>mat;
cout<<"請輸入新的語文成績:"<<endl;
cin>>chin;
cout<<"請輸入新的外語成績:"<<endl;
cin>>eng;
s[h]->chinese=chin;
s[h]->math=mat;
s[h]->english=eng;
cout<<"數據修改成功!";
}
}
if(flag2==0)
{
cout<<"您要修改的學生本來就不存在!請檢查重新輸入!"<<endl;
}
cout<<"想繼續修改嗎(y/n)"<<endl;
cin>>c;
if(c!='y'&&c!='n')
{
cout<<"指令錯誤!請重新輸入!"<<endl;
cin>>c;
}
}while(c=='y');
break;
}
case '4':
{
double t;char c;
do
{
int flag1=0;
cout<<"請輸入你要查詢學生的學號"<<endl;
cin>>t;
for(int q=0;q<i;q++)
{
if(s[q]->number==t)
{
flag1=1;
cout<<"您要查詢的學生是:"<<(*s[q]).name
<<"數學成績為:"<<s[q]->math
<<"語文成績為:"<<s[q]->chinese
<<"英語成績為:"<<s[q]->english
<<"總分為:"<<s[q]->getsum()
<<endl;
}
}
if(flag1==0)
cout<<"對不起!您要查詢的學生不存在!"<<endl;
cout<<"您想繼續查詢嗎?(y/n)"<<endl;
cin>>c;
if(c!='y'&&c!='n')
{
cout<<"指令錯誤!請重新輸入!"<<endl;
cin>>c;
}
}
while(c=='y');
break;
}
case '5':
{
char n[20];int j=0;char c;
do{
int flag=0;
cout<<"請輸入你要查詢的學生姓名"<<endl;
cin>>n;
for(int j=0;j<i;j++)
{
if(strcmp(n,(*s[j]).name)==0)
{
flag=1;
cout<<"您要查詢的學生是:"<<(*s[j]).name
<<endl;
cout<<(*s[j]).name<<"的總成績成績是"<<(*s[j]).getsum()
<<"班級:"<<" "<<s[j]->ba
<<"語文:"<<" "<<s[j]->chinese
<<"數學:"<<" "<<s[j]->math
<<"外語:"<<" "<<s[j]->english
<<"平均成績是:"<<(*s[j]).getaver()
<<endl;
}
}
if(flag==0)
cout<<"對不起!您要查詢的學生不存在!"<<endl;
cout<<"您想繼續查詢嗎?(y/n)"<<endl;
cin>>c;
if(c!='y'&&c!='n')
{
cout<<"指令錯誤!請重新輸入!"<<endl;
cin>>c;
}
}
while(c=='y');
break;
}
case '6':
{
cout<<"本系統所有學生數據如下:"<<endl;
if(i==0)
cout<<"管理系統中沒有錄入數據或者數據已經被刪除!"<<endl;
for(int k=0;k<i;k++)
{
cout<<k+1<<" "<<"姓名:"<<" "<<s[k]->name
<<"班級"<<s[k]->ba
<<"學號"<<s[k]->number
<<"語文:"<<" "<<s[k]->chinese<<"數學:"
<<" "<<s[k]->math
<<"外語:"<<" "<<s[k]->english
<<"總分:"<<" "<<(*s[k]).getsum()
<<"平均分:"<<" "<<(*s[k]).getaver()
<<endl;
}
break;
}
case '7':
{
int t;stu b;
cout<<"本系統所有學生總分排名如下:"<<endl;
for(int x=0;x<i-1;x++)
{
t=x;
for(int y=x+1;y<i;y++)
{
if((s[t]->getsum())<(s[y]->getsum()))
t=y;
if(t!=x)
{
b=*s[x];
*s[x]=*s[t];
*s[t]=b;
}
}
}
if(i==0)
cout<<"管理系統中沒有錄入數據或者數據已經被刪除!";
double o1,o2;
for(int k=0;k<i;k++)
{
cout<<k+1<<" "<<"姓名:"<<" "<<s[k]->name
<<"班級"<<s[k]->ba
<<"學號"<<s[k]->number
<<"語文:"<<" "<<s[k]->chinese
<<"數學:"<<" "<<s[k]->math
<<"外語:"<<" "<<s[k]->english
<<"總分:"<<" "<<s[k]->getsum()
<<"平均分:"<<" "<<s[k]->getaver()
<<endl;
o1=s[k]->sum;
o2=s[0]->sum;
}
cout<<"總分最高分"<<o2<<endl
<<"總分最低分"<<o1<<endl
<<endl;
break;
}
case '8':
{
int t;stu b;
cout<<"本系統所有學生語文排名如下:"<<endl;
for(int x=0;x<i-1;x++)
{
t=x;
for(int y=x+1;y<i;y++)
{
if((s[t]->chinese)<(s[y]->chinese))
t=y;
if(t!=x)
{
b=*s[t];
*s[t]=*s[x];
*s[x]=b;
}
}
}
if(i==0)
cout<<"管理系統中沒有錄入數據或者數據已經被刪除!";
double o1 ,o2;
for(int k=0;k<i;k++)
{
cout<<k+1<<" "<<"姓名:"<<" "<<s[k]->name
<<"班級"<<s[k]->ba
<<"學號"<<s[k]->number
<<"語文:"<<" "<<s[k]->chinese
<<"數學:"<<" "<<s[k]->math
<<"外語:"<<" "<<s[k]->english
<<"總分:"<<" "<<s[k]->getsum()
<<"平均分:"<<" "<<s[k]->getaver()
<<endl;
o1=s[k]->chinese;
o2=s[0]->chinese;
}
int v1=0,v2=0;double v3;
for(v2=0;v2<=i-1;v2++)
{
if(s[v2]->english>=60)
v1++;
}
v3=(v1*100)/v2;
cout<<"語文最高分"<<o2<<endl
<<"語文最低分"<<o1<<endl
<<"語文及格率"<<v3<<"%"
<<endl;
break;
}
case '9':
{
int t;stu b;
cout<<"本系統所有學生數學排名如下:"<<endl;
for(int x=0;x<i-1;x++)
{
t=x;
for(int y=x+1;y<i;y++)
{
if((s[t]->math)<(s[y]->math))
t=y;
if(t!=x)
{
b=*s[t];
*s[t]=*s[x];
*s[x]=b;
}
}
}
if(i==0)
cout<<"管理系統中沒有錄入數據或者數據已經被刪除!";
double o1,o2;
for(int k=0;k<i;k++)
{
cout<<k+1<<" "<<"姓名:"<<" "<<s[k]->name
<<"班級"<<s[k]->ba
<<"學號"<<s[k]->number
<<"語文:"<<" "<<s[k]->chinese
<<"數學:"<<" "<<s[k]->math
<<"外語:"<<" "<<s[k]->english
<<"總分:"<<" "<<s[k]->getsum()
<<"平均分:"<<" "<<s[k]->getaver()
<<endl;
o1=s[k]->math;
o2=s[0]->math;
}
int v1=0,v2=0;double v3;
for(v2=0;v2<=i-1;v2++)
{
if(s[v2]->english>=60)
v1++;
}
v3=(v1*100)/v2;
cout<<"數學最高分"<<o2<<endl
<<"數學最低分"<<o1<<endl
<<"數學及格率"<<v3<<"%"
<<endl;
break;
}
case 'y':
{
int t;stu b;
cout<<"本系統所有學生英語排名如下:"<<endl;
for(int x=0;x<i-1;x++)
{
t=x;
for(int y=x+1;y<i;y++)
{
if((s[t]->english)<(s[y]->english))
t=y;
if(t!=x)
{
b=*s[t];
*s[t]=*s[x];
*s[x]=b;
}
}
}
if(i==0)
cout<<"管理系統中沒有錄入數據或者數據已經被刪除!";
double o1,o2;
for(int k=0;k<i;k++)
{
cout<<k+1<<" "<<"姓名:"<<" "<<s[k]->name
<<"班級"<<s[k]->ba
<<"學號"<<s[k]->number
<< "語文:"<<" "<<s[k]->chinese
<<"數學:"<<" "<<s[k]->math
<<"外語:"<<" "<<s[k]->english
<<"總分:"<<" "<<s[k]->getsum()
<<"平均分:"<<" "<<s[k]->getaver()
<<endl;
o1=s[k]->english;
o2=s[0]->english;
}
int v1=0,v2=0;double v3;
for(v2=0;v2<=i-1;v2++)
{
if(s[v2]->english>=60)
v1++;
}
v3=(v1*100)/v2;
cout<<"英語最高分"<<o2<<endl
<<"英語最低分"<<o1<<endl
<<"英語及格率"<<v3<<"%"
<<endl;
}
break;
}
cout<<"您想繼續進行其他操作嗎?(y/n)"<<endl;
bool flag4=0;
do
{
cin>>w;
if(w!='y'&&w!='n')
cout<<"指令錯誤!請重新輸入!"<<endl;
else
flag4=1;
}while(flag4==0);
if(w=='y')
cout<<" 請輸入操作代碼: "<<endl;
cout<<"0 錄入 1 增加人員 2 刪除人員"<<endl;
cout<<"3 修改數據 4 按學號查詢 5 按姓名查詢"<<endl;
cout<<"6 顯示所有成員數據 7 按總分排名 8 按語文排名"<<endl;
cout<<"9 按數學排名 y按英語排名"<<endl;
cin>>p;
}while(w=='y');
}
Ⅷ 學生成績管理系統c
#include "stdio.h"
#include<conio.h>
#include<string.h>
#include<stdlib.h>
struct book{
char number[21];
char shuming[30];
int shuliang;
int jiage;
char zhuanye[20];
char zuozhe[26];
char chubanshe[20];
char beizhu[100];
struct book *next;
};
struct book *creat() /*創建鏈表*/
{
struct book *p,*head,*end;
head=end=p=(struct book *)malloc(sizeof(struct book));
printf("輸入教材編號為0結束輸入,每項信息都必須輸入內容。\n");
do
{
printf("\n教材編號:");
gets(p->number);
if(strcmp(p->number,"0")==0){ end->next=NULL; return head;}
end=p;
printf("\n教材名稱:");
gets(p->shuming);
printf("\n教材數量:");
scanf("%d",&p->shuliang);
printf("\n教材價格:");
scanf("%d",&p->jiage);
getchar();
printf("\n教材專業:");
gets(p->zhuanye);
printf("\n教材作者:");
gets(p->zuozhe);
printf("\n教材出版社:");
gets(p->chubanshe);
printf("\n備注:");
gets(p->beizhu);
p=(struct book *)malloc(sizeof(struct book));
end->next=p;
}while(1);
}
void save(struct book *head) /*保存鏈表*/
{FILE *fp;
struct book *p;
char filename[30];
int ch;
printf("請輸入「文件名.後綴」:");
scanf("%s",filename);
if((fp=fopen(filename,"r"))!=NULL)
{
printf("\n該文件已存在,是否覆蓋?1,是 2,否");
scanf("%d",&ch);
if(ch!=1)
return;
}
if((fp=fopen(filename,"w"))==NULL) { printf("\n文件保存失敗");getchar();return;}
p=head;
do{
fprintf(fp,"\n%s",p->number);
fprintf(fp,"\n%s",p->shuming);;
fprintf(fp,"\n%d",p->shuliang);
fprintf(fp,"\n%d",p->jiage);
fprintf(fp,"\n%s",p->zhuanye);
fprintf(fp,"\n%s",p->zuozhe);
fprintf(fp,"\n%s",p->chubanshe);
fprintf(fp,"\n%s",p->beizhu);
p=p->next;
}while(p!=NULL);
fprintf(fp," over");
printf("\n成功保存");
getchar();
getchar();
fclose(fp);
}
void print(struct book *head) /*輸出鏈表*/
{
struct book *p;
p=head;
if(p==NULL) { printf("未打開任何文件,無法顯示"); getch();return;}
do{
printf("\n\n教材編號:%s",p->number);
printf("\n教材名稱:%s",p->shuming);;
printf("\n數量:%d",p->shuliang);
printf("\n價格:%d",p->jiage);
printf("\n專業:%s",p->zhuanye);
printf("\n作者:%s",p->zuozhe);
printf("\n出版社:%s",p->chubanshe);
printf("\n備註:%s",p->beizhu);
p=p->next;
}while(p!=NULL);
}
struct book *openfile() /*打開文件*/
{struct book *p,*f,*head;
FILE *fp;
char filename[20];
printf("\n請輸入路徑,文件名,和後綴):");
scanf("%s",filename);
if((fp=fopen(filename,"r"))==NULL){ printf("\n文件找不到,請檢查是否有該文件和路徑是否正確");getchar();return NULL;}
head=f=p=(struct book *)malloc(sizeof(struct book));
fscanf(fp,"%s%s%d%d%s%s%s%s",p->number,p->shuming,&p->shuliang,&p->jiage,p->zhuanye,p->zuozhe,p->chubanshe,p->beizhu);
while(!feof(fp))
{ p=(struct book *)malloc(sizeof(struct book));
f->next=p;
fscanf(fp,"%s%s%d%d%s%s%s%s",p->number,p->shuming,&p->shuliang,&p->jiage,p->zhuanye,p->zuozhe,p->chubanshe,p->beizhu);
if(strcmp(p->number,"over")==0){ f->next=NULL; printf("\n文件打開成功,可以顯示此信息");getchar(); return head; }
f=p;
}
return head;
}
void namesort(struct book *head) /*按教材名稱排序*/
{ struct book *p,*t,*f,*h;
char ch[20];
int i;
h=t=f=p=head;
if(head==NULL) {printf("未打開任何文件");getchar();return; };
f=p->next;
for(p=head;p->next!=NULL;p=p->next)
{
for(t=head,f=t->next;t->next!=NULL;f=f->next,t=t->next)
{
if(strcmp(t->shuming,f->shuming)>0)
{
strcpy(ch,t->number );
strcpy(t->number,f->number);
strcpy(f->number,ch);
strcpy(ch,t->shuming );
strcpy(t->shuming,f->shuming);
strcpy(f->shuming,ch);
i=t->shuliang ;
t->shuliang=f->shuliang;
f->shuliang=i;
i=t->jiage ;
t->jiage=f->jiage;
f->jiage=i;
strcpy(ch,t->zhuanye);
strcpy(t->zhuanye,f->zhuanye);
strcpy(f->zhuanye,ch);
strcpy(ch,t->zuozhe);
strcpy(t->zuozhe,f->zuozhe);
strcpy(f->zuozhe,ch);
strcpy(ch,t->chubanshe);
strcpy(t->chubanshe,f->chubanshe);
strcpy(f->chubanshe,ch);
strcpy(ch,t->beizhu);
strcpy(t->beizhu,f->beizhu);
strcpy(f->beizhu,ch);
}
}
}
print(h);
}
void chubanshesort(struct book *head) /*按出版社排序*/
{ struct book *p,*t,*f,*h;
char ch[20];
int i;
h=t=f=p=head;
if(head==NULL) {printf("未打開任何文件");getchar();return; }
f=p->next;
for(p=head;p->next!=NULL;p=p->next)
{
for(t=head,f=t->next;t->next!=NULL;f=f->next,t=t->next)
{
if(strcmp(t->chubanshe,f->chubanshe)>0)
{
strcpy(ch,t->number );
strcpy(t->number,f->number);
strcpy(f->number,ch);
strcpy(ch,t->shuming );
strcpy(t->shuming,f->shuming);
strcpy(f->shuming,ch);
i=t->shuliang ;
t->shuliang=f->shuliang;
f->shuliang=i;
i=t->jiage ;
t->jiage=f->jiage;
f->jiage=i;
strcpy(ch,t->zhuanye);
strcpy(t->zhuanye,f->zhuanye);
strcpy(f->zhuanye,ch);
strcpy(ch,t->zuozhe);
strcpy(t->zuozhe,f->zuozhe);
strcpy(f->zuozhe,ch);
strcpy(ch,t->chubanshe);
strcpy(t->chubanshe,f->chubanshe);
strcpy(f->chubanshe,ch);
strcpy(ch,t->beizhu);
strcpy(t->beizhu,f->beizhu);
strcpy(f->beizhu,ch);
}
}
}
print(h);
}
void shumingsearch(struct book *head) /*按教材名稱查找*/
{ struct book *p;
char name[20];
int c;
if(head==NULL) {printf("未打開任何文件");getchar();return;}
printf("1,查找專業 2,查找教材名稱:");
scanf("%d",&c);
getchar();
if(c==2)
printf("請輸入要查找的教材名稱:");
else printf("請輸入要查找的專業:");
gets(name);
p=head;
do{ if(c==2)
if(strcmp(p->shuming,name)==0)
{
printf("教材編號:%s\n教材名稱:%s\n數量:%d\n價格:%d\n專業:%s\n作者:%s\n出版社:%s\n備註:%s\n",p->number,p->shuming,p->shuliang,p->jiage,p->zhuanye,p->zuozhe,p->chubanshe,p->beizhu);
}
if(c==1)
if(strcmp(p->zhuanye,name)==0)
{
printf("教材編號:%s\n教材名稱:%s\n數量:%d\n價格:%d\n專業:%s\n作者:%s\n出版社:%s\n備註:%s\n",p->number,p->shuming,p->shuliang,p->jiage,p->zhuanye,p->zuozhe,p->chubanshe,p->beizhu);
}
p=p->next;
}while(p!=NULL);
printf("查找完成");
return;
}
struct book *add(struct book *head) /*增加記錄*/
{ struct book *p,*e,*f,*h;
if(head==NULL) {printf("未打開任何文件");getchar(); return NULL;}
h=f=e=head;
p=(struct book *)malloc(sizeof(struct book));
printf("\n教材編號:");
gets(p->number);
printf("\n教材名稱:");
gets(p->shuming);
printf("\n數量:");
scanf("%d",&p->shuliang);
printf("\n價格:");
scanf("%d",&p->jiage);
getchar();
printf("\n專業:");
gets(p->zhuanye);
printf("\n作者:");
gets(p->zuozhe);
printf("\n出版社:");
gets(p->chubanshe);
printf("\n備注:");
gets(p->beizhu);
if(strcmp(f->number,p->number)>0) { p->next=f;h=p;printf("\n添加成功");return h;}
if(f->next==NULL) { f->next=p;p->next=NULL;printf("\n添加成功");return h;}
do{
if(f->next!=NULL)
if(strcmp(f->number,p->number)>0)
{
e->next=p;p->next=f;printf("\n添加成功");return h;
}
if(f->next==NULL)
{
f->next=p;
p->next=NULL;
printf("\n添加成功");
return h;
}
f=f->next;
e=e->next;
}while(1);
}
struct book *delet(struct book *head) /*刪除記錄*/
{ struct book *p,*e;
char num[20];
if(head==NULL) {printf("未打開任何文件");getchar();return NULL;}
printf("請輸入要刪除的教材編號:");
scanf("%s",num);
p=e=head;
if(strcmp(p->number,num)==0) { head=head->next; print(head);return head;}
else p=p->next;
do{
if(strcmp(p->number,num)==0)
{
if(p->next!=NULL)
e->next=p->next;
if(p->next==NULL) e->next=NULL;
print(head);
return head;
}
p=p->next;
e=e->next;
}while(p!=NULL);
printf("搜索完畢,未找到該記錄");
return head;
}
struct book *change(struct book *head) /*修改記錄*/
{ struct book *p;
char num[20];
if(head==NULL) {printf("未打開任何文件");getchar();return NULL;}
printf("請輸入要修改的教材編號:");
scanf("%s",num);
getchar();
p=head;
do{
if(strcmp(p->number,num)==0)
{
printf("教材編號:%s\n教材名稱:%s\n數量:%d\n價格:%d\n專業:%s\n作者:%s\n出版社:%s\n備註:%s\n",p->number,p->shuming,p->shuliang,p->jiage,p->zhuanye,p->zuozhe,p->chubanshe,p->beizhu);
printf("\n教材編號:");
gets(p->number);
printf("\n教材名稱:");
gets(p->shuming);
printf("\n數量:");
scanf("%d",&p->shuliang);
printf("\n價格:");
scanf("%d",&p->jiage);
getchar();
printf("\n專業:");
gets(p->zhuanye);
printf("\n作者:");
gets(p->zuozhe);
printf("\n出版社:");
gets(p->chubanshe);
printf("\n備注:");
gets(p->beizhu);
printf("修改成功");
return head;
}
p=p->next;
}while(p!=NULL);
printf("未找到要修改的記錄");
return head;
}
int mima()
{ FILE *fp;
char mima1[20],mima2[20];
if((fp=fopen("mima","r"))==NULL)
{ printf("尚未設置密碼請輸入:");
scanf("%s",mima1);
printf("請再次輸入密碼:");
scanf("%s",mima2);
if(strcmp(mima1,mima2)!=0) { printf("兩次密碼不一樣");return 0;}
else {
fp=fopen("mima","w");
fprintf(fp,"%s",mima1);
printf("密碼設置成功");
return 1;
}
}
printf("請輸入初始化密碼:");
scanf("%s",mima1);
fscanf(fp,"%s",mima2);
if(strcmp(mima1,mima2)==0)
{
printf("密碼正確");
printf("請輸入要刪除的文件名:");
scanf("%s",mima1);
if(remove(mima1)==0)
{
printf("刪除成功");
getchar();
return 1;
}
else {
printf("刪除失敗,請檢查是否存在該文件或路徑是否正確");
getchar();
return 0;
}
}
else {
printf("密碼錯誤");
getchar();
return 0;
}
}
void main()
{
struct book *head=NULL;
char i;
printf(" 88888888888 \n");
printf(" d88888888888b \n");
printf(" d88888 88888b \n");
printf(" d88P 88b \n");
printf(" 888' `88b \n");
printf(" 88P Y88 \n");
printf(" 88 88\n");
printf(" 88 88\n");
printf(" 88 88\n");
printf(" 88 88\n");
printf(" 88 88\n");
printf(" 88 ,aa. ,aa. 88 \n");
printf(" 88 d88b d88b 88 \n");
printf(" ,=88 Y88P Y88P 88=, \n");
printf(" ,d88P' `' _aa_ `' `Y88b, \n");
printf(" 88P' (8888) `Y88 ad88888b \n");
printf(" 88 ~^^~ 88 d88Y Y8b\n");
printf(" Yb._ _.d8 d8Y 88\n");
printf(" d88888888ba888=,. .,=8888 d88 88 \n");
printf(" ★☆88P Y88~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~★☆\n");
printf(" ★☆ 88 88 ★☆\n");
printf(" ★☆88 88 歡迎使用本教材系統,按任意鍵進入系統 ★☆\n");
printf(" ★☆ 8b,___,d8 ★☆\n");
printf(" ★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆\n");
getch();
system("cls");
do{
printf(" ☆★☆★☆★ 教材管理系統 ☆★☆★☆★\n");
printf("m--菜單 h--幫助");
printf("\n請輸入命令:");
i=getch();
if(i=='h')
{ printf("\n1,錄入教材信息的時候,每一個項目都必須輸入相應的內容。\n2,修改,增加,刪除,查找記錄前必須先打開一個文件,修改完後必須記得保存教材信息。\n3,必須使用正確的路徑打開文件,建議保存文件時候不用輸入路徑(此時是默認路徑,即保存在程序目錄下。)");
getch();
break;
}
if(i=='m')
break;
system("cls");
}while(i!='m'||i!='h');
system("cls");
do{
printf(" ☆★☆★☆★ 教材管理系統 ☆★☆★☆★\n");
printf("┌————-———┐\n");
printf("│1,錄入教材信息│\n│2,顯示教材信息│\n│3,打開一個記錄│\n│4,編輯一個記錄│\n│5,保存教材信息│\n│6,查找記錄 │\n│s,初始化系統 │\n│e,退出系統 │\n");
printf("└———————-┘\n");
printf("\n請輸入功能編號:");
i=getch();
system("cls");
switch(i)
{
case '1': head=creat();save(head);break;
case '2': print(head);break;
case '3': head=openfile();break;
case '4': system("cls");
printf("┌————-———┐\n");
printf("│1,增加一個記錄│\n");
printf("│2,刪除一個記錄│\n");
printf("│3,修改一個記錄│\n");
printf("└———————-┘\n");
i=getch();
switch(i)
{
case '1':
head=add(head);break;
case '2':
head=delet(head);break;
case '3': head=change(head);break;
default: break;
}
break;
case '5': save(head);break;
case '6': shumingsearch(head);break;
case 's': mima();break;
case 'e': exit(0);
default :break;
}
system("cls");
}while(1);
}
我想這個程序包含了你那個成績管理系統的全部要求,但我這個是教材管理系統我想改一下就可以了,具體如何改就要看樓主的天賦咯,呵呵。參考一下吧
Ⅸ 如何列印學信網學歷證明
1、首先打開電腦瀏覽器,網路搜索「學信網」。
Ⅹ 求用C++編寫簡單的學生成績管理系統!!!~~~
發給你了