C語言學生資訊系統課設
本系統基於C語言開發,適用於剛入門的C語言新手專案課設,開發軟體採用VC++6.0開發,VS,DEV C++等均可執行。
專案執行截圖
程式碼介面截圖
部分關鍵程式碼
//2查詢學生資訊
Node *Inquire_Students()
{
//清屏
system("CLS");
printf("=================================================\n");
printf("===============歡迎使用高校學生管理系統==========\n");
printf("=================================================\n");
printf("===================查詢學生資訊功能================\n");
printf("=================================================\n");
char Num[10]; //學號
printf("\n請輸入需要查詢學生的學號:\n");
scanf("%s",Num);
Node *p = g_pHead;
printf("\n學號\t姓名\t平時成績\t期末成績\t總評成績\t\n");
//遍歷連結串列
while (p != NULL)
{
/*if (p->Stu.Num == Num)字元陣列不能比較
需要字元比較呼叫函式stricmp以大小寫不敏感方式比較兩個串
用法:int stricmp( char *str1, char *str2);
返回值大於0,則str1>str2
返回值小於0,則str1<str2
返回值等於0,則str1=str2*/
int ptr = _stricmp(p->Stu.Num , Num);
//如果找到學生資訊
if (ptr == 0)
{
return p;
}
//否則繼續找,直到遍歷完連結串列退出while
p = p->pNext;
}
//遍歷完沒有找到學生資訊
if (p == NULL)
{
return NULL;
}
return NULL;
}
//3顯示學生資訊
void Display_Students()
{
//清屏
system("CLS");
printf("=================================================\n");
printf("===============歡迎使用高校學生管理系統==========\n");
printf("=================================================\n");
printf("===================顯示學生資訊功能================\n");
printf("=================================================\n");
Node *p = g_pHead;
printf("學號\t|姓名\t|平時成績\t|期末成績\t|總評成績\t|\n");
//如果連結串列裡沒有學生資訊
if (p == NULL)
{
printf("未找到學生資訊,請先錄入學生資訊!\n\n");
return;
}
//如果連結串列裡有學生資訊,則遍歷連結串列
while (p != NULL)
{
printf("%s\t| %s\t| %0.2lf \t| %0.2lf \t| %0.2lf\t|\n",
p->Stu.Num, //學號
p->Stu.Name, //姓名
p->Stu.Regular_Score, //平時成績
p->Stu.Final_Score, //期末成績
p->Stu.Total_Score); //總評成績);
p = p->pNext;
}
printf("=================================================\n");
return;
}
獲取完整原始碼:
https://max.book118.com/html/2020/1010/7053033012003005.shtm
https://wenku.baidu.com/view/28e4b39a7f21af45b307e87101f69e314232fac7