c語言設計管理系統
1. 用c語言設計一個學生管理系統
高二的時候,我自己寫過。現在在學其它的語言,就不獻丑了,在網上給你找到了,是網路文庫裡面的,直接復制過來的話,排版不對,你自己去看一下吧,完整的代碼。
名字就是《用C語言編寫的一個學生信息管理系統》
PS:寫這個,主要是用到C語言的鏈表,不難,只是有的時候,如果思路不清晰的話,容易寫錯,寫漏等等,如果不參考上面,而是你自己寫的話,建議先畫個大概的樹圖出來,再開始編吧。
純手工打的,幫到你的話,就採納吧。
2. c語言 設計一個銀行管理系統
功能:能夠輸入和查詢客戶存款取款記錄。在客戶文件中,每個客戶是一條記錄,包括編號、客戶姓名、支取密碼、客戶地址、客戶電話、賬戶總金額;在存取款文件中,每次存取款是一條記錄,包括編號、日期、類別、存取數目、經辦人。類別分為取款和存款兩種。本系統能夠輸入客戶存款或取款記錄;根據客戶姓名查詢存款和取款記錄。分步實施:1、初步完成總體設計,搭好框架,確定人機對話界面,確定函數個數;2、建立一個文件,輸入客戶的必要信息,能對文件進行顯示、輸入、修訂、刪除等。3、進一步要求:完成客戶姓名查詢存款和取款記錄,並能得到每次帳戶總金額。要求:1、用C語言實現系統;2、利用結構體數組實現信息的數據結構設計;3、系統的各個功能模塊要求用函數的形式實現;4、界面友好(良好的人機交互),程序加必要的注釋。課程設計實驗報告要求:1、預習報告:題目、課程設計任務、數據結構、程序的總體設計(演算法)、模塊劃分 。2、實驗總結報告:流程圖、主要源程序代碼(需列印)、測試情況及調試中問題與解決方案、小結等要求:標明所用函數的用途和目的,簡單敘述製作思路。
是否可以解決您的問題?
3. 用C語言設計圖書管理系統
addbook()
{
FILE *fp;
int i=0;
char choice='y';
fp=fopen("book.txt","a+");
while(choice=='y'||choice=='Y')
{
i++;
printf("\n\t\t\t〓〓〓〓〓歡迎進入管理系統〓〓〓〓〓\n\n");
printf("\t\t\t請你輸入第%d本書的序號 \n",i);
scanf("%s",&book[i].booknum);
printf("請你輸入書名\n");
scanf("%s",book[i].bookname);
printf("請你輸入書的作者\n");
scanf("%s",book[i].bookcreat);
printf("請設為1或0,1代表書還沒人借,0表示書已經借出,設其他值,程序運行時無法得出正常結果\n");
printf("請你設定書的狀態\n");
scanf("%d",&book[i].turefalse);
fwrite(&book[i],sizeof(struct book),1,fp);
printf("是否要輸入下本書? 提示:輸入下一本書時;Y/y,不輸入下一本書時任意鍵返回\n");
if(choice=='y'||choice=='Y')
scanf("%s",&choice);
}
fclose(fp);
return;
}
delbook()
{
FILE *fp,*fp2;
int i;
char bookname[10],choice;
fp=fopen("book.txt","r");
fp2=fopen("bookl.txt","w");
printf("請輸入你要刪除的書名\n");
printf("如果你輸入的書名存在,系統自動刪除該信息!如果不存在,系統不做任何改動\n");
scanf("%s",bookname);
for(i=0;fread(&book[i],sizeof(struct book),1,fp)!=0;i++)
{
if(strcmp(bookname,book[i].bookname)!=0)
{
fwrite(&book[i],sizeof(struct book),1,fp2);
}
}
fclose(fp);
fclose(fp2);
printf("是否真的要刪除該書籍?刪除後該書籍的所有信息將無法恢復《Y/N》\n");
scanf("%s",&choice);
if(choice=='y'||choice=='Y')
{
fp=fopen("book.txt","w");
fp2=fopen("bookl.txt","r");
for(i=0;fread(&book[i],sizeof(struct book),1,fp2)!=0;i++)
{
fwrite(&book[i],sizeof(struct book),1,fp);
}
fclose(fp);
fclose(fp2);
fp2=fopen("bookl.txt","w");
fclose(fp2);
printf("按任意鍵返回\n");
getch();
return;
}
else
{
printf("按任意鍵返回\n");
getch();
return;
}
}
huanbook() /*還書函數*/
{
FILE *fp,*fp2; /*定義兩個文件指針,fp2用於修改數據時設立臨時文件用,防止數據遭破壞*/
int i,n;
int carnum;
char lendbook[10];
printf("請你輸入你的卡號\n");
scanf("%d",&carnum);
fp=fopen("car.txt","r"); /*讀取卡號記錄*/
for(i=0;fread(&car[i],sizeof(struct car),1,fp)!=0;i++) /*for循環判斷卡號是否存在*/
{
if(car[i].carnum==carnum) /*卡號存在,進入下一循環*/
{
n=i;
fclose(fp);
printf("請輸入你要還的書的名字\n");
scanf("%s",lendbook);
fp=fopen("record.txt","r");
for(i=0;fread(&student[i],sizeof(struct student),1,fp)!=0;i++) /*判斷是否借閱了輸入的書*/
{
if(strcmp(student[i].lendbook,lendbook)==0) /*借閱了該書,進入下一循環,否則出錯顯示*/
{
fclose(fp);
fp=fopen("record.txt","r");
fp2=fopen("bookl.txt","w");
for(i=0;fread(&student[i],sizeof(struct student),1,fp)!=0;i++)
{
if(strcmp(student[i].lendbook,lendbook)==0)
{
continue; /*刪除還掉的書的借書記錄*/
}
fwrite(&student[i],sizeof(struct student),1,fp2); /*寫入原來沒還的書的記錄*/
}
fclose(fp);
fclose(fp2);
fp=fopen("record.txt","w");
fp2=fopen("bookl.txt","r");
for(i=0;fread(&student[i],sizeof(struct student),1,fp2)!=0;i++)
{
fwrite(&student[i],sizeof(struct student),1,fp); /*將借書記錄信息寫回*/
}
fclose(fp);
fclose(fp2);
fopen("bookl.txt","w"); /*清臨時文件的記錄*/
fclose(fp2);
fp=fopen("book.txt","r");
fp2=fopen("bookl.txt","w");
for(i=0;fread(&book[i],sizeof(struct book),1,fp)!=0;i++) /*將書的記錄寫入臨時文件,防止因為修改信息破壞以前的記錄*/
{
if(i==n)
{
book[i].turefalse=1;
fwrite(&book[i],sizeof(struct book),1,fp2); /*將還的書的原來狀態設為無人借閱的*/
continue;
}
fwrite(&book[i],sizeof(struct book),1,fp2);
}
fclose(fp);
fclose(fp2);
fp=fopen("book.txt","w");
fp2=fopen("bookl.txt","r");
for(i=0;fread(&book[i],sizeof(struct book),1,fp2)!=0;i++)
{
fwrite(&book[i],sizeof(struct book),1,fp); /*將臨時文件寫回*/
}
fclose(fp);
fclose(fp2);
fopen("bookl.txt","w"); /*清臨時文件*/
fclose(fp2);
printf("還書完畢,按任意鍵返回\n");
getch();
return 1;
}
}
printf("你沒有借這樣的書,任意鍵返回\n"); /*出錯提示*/
fclose(fp);
getch();
return 0;
}
}
printf("系統沒這樣的卡,和管理員聯系,按任意鍵返回\n"); /*出錯提示*/
fclose(fp);
getch();
}
findbook()
{
FILE *fp;
char bookname[10];
int ture,i;
fp=fopen("book.txt","r");
printf("請輸入你要查找的書名\n");
scanf("%s",bookname);
for(i=0;fread(&book[i],sizeof(struct book),1,fp)!=0;i++)
{
if(strcmp(bookname,book[i].bookname)==0)
{
if(book[i].turefalse==1)
{
printf("這本書的詳細資料是:%d %s %s 此書現在無人借閱\n按任意鍵返回\n",book[i].booknum,book[i].bookname,book[i].bookcreat);
}
else
{
printf("這本書已經有人借出\n");
fclose(fp);
return 0;
}
fclose(fp);
return FALSE;
}
}
printf("沒有你要查詢的書籍\n");
fclose(fp);
return FALSE;
}
chabook()
{
char ch5;
do
{
printf("\n\t\t\t〓〓〓〓〓歡迎進入學生管理系統〓〓〓〓〓\n\n");
printf(" \t\t\t1:<按書名查找>\n");
printf(" \t\t\t2:<按作者查找>\n");
printf(" \t\t\t0:<返回>\n");
printf("請輸入0--2,其他輸入非法!\n");
scanf("%s",&ch5);
switch(ch5)
{
case '1':findbook();getch();break;
case '2':findbook1();getch();break;
case '0':break;
default:printf("無此操作\n");getch();break;
}
}while(ch5!='0');
return FALSE;
}
lendbook()
{
FILE *fp,*fp2;
int i,n;
int carnum;
printf("請你輸入你的卡號\n");
scanf("%d",&carnum);
fp=fopen("car.txt","r");
for(i=0;fread(&car[i],sizeof(struct car),1,fp)!=0;i++)
{
if(car[i].carnum==carnum)
{
n=i;
fclose(fp);
printf("請輸入你要借閱的書的名字\n");
scanf("%s",student[n].lendbook);
fp=fopen("book.txt","r");
for(i=0;fread(&book[i],sizeof(struct book),1,fp)!=0;i++)
{
if(strcmp(book[i].bookname,student[n].lendbook)==0)
{
if(book[i].turefalse==0)
{
printf("對不起,此書有人借出,請借其他書\n");
fclose(fp);
getch();
return;
}
else
fclose(fp);
fp=fopen("record.txt","a+");
student[n].carnum=carnum;
fwrite(&student[n],sizeof(struct student),1,fp);
fclose(fp);
fp=fopen("book.txt","r");
fp2=fopen("bookl.txt","w");
for(i=0;fread(&book[i],sizeof(struct book),1,fp)!=0;i++)
{
if(strcmp(book[i].bookname,student[n].lendbook)==0)
{
book[i].turefalse=0;
fwrite(&book[i],sizeof(struct book),1,fp2);
continue;
}
fwrite(&book[i],sizeof(struct book),1,fp2);
}
fclose(fp);
fclose(fp2);
fp=fopen("book.txt","w");
fp2=fopen("bookl.txt","r");
for(i=0;fread(&book[i],sizeof(struct book),1,fp2)!=0;i++)
{
fwrite(&book[i],sizeof(struct book),1,fp);
}
fclose(fp);
fclose(fp2);
fopen("bookl.txt","w");
fclose(fp2);
printf("借書完畢,按任意鍵返回\n");
getch();
return;
}
}
printf("不存在這樣的書,任意鍵返回\n");
fclose(fp);
getch();
return;
}
}
printf("你的卡號不存在,請申請新卡,按任意鍵返回\n");
fclose(fp);
getch();
}
4. C語言程序設計的圖書管理系統
我們也開始做課程設計了呢~~~ 這是我同學做的:
#include
#include
#include
struct BOOK
{
int id,usr[10],total,store,days[10];
char name[31],author[21];
}books[100];
/*上面是結構體的定義,用於存放書籍及借書的信息。*/
void page_title(char *menu_item)
{
clrscr();
printf(">>> 圖 書 管 理 系 統 <<<\n\n- %s -\n\n",menu_item);
}
/*上面是列印頁眉的函數,同時通過參數menu_item,可以顯示當前的狀態。*/
void return_confirm(void)
{
printf("\n按任意鍵返回……\n");
getch();
}
/*上面是返回前請求確認的函數,以便在返回前觀察結果*/
int search_book(void)
{
int n,i;
printf("請輸入圖書序號:");
scanf("%d",&i);
for(n=0;n<100;n++)
{
if(books[n].id==i)
{
printf("書名:%s\n",books[n].name);
printf("作者:%s\n",books[n].author);
printf("存數:%d of ",books[n].store);
printf("%d\n",books[n].total);
return n;
}
}
printf("\n輸入錯誤或無效圖書序號.\n");
return -1;
}
/*上面的函數是在數組中找到圖書號匹配的記錄,顯示其信息並返
回數組下標,如果找不到相應記錄則提示錯誤並返回-1。*/
void book_out(void)
{
int n,s,l,d;
page_title("借閱圖書");
if((n=search_book())!=-1&&books[n].store>0)
{
printf("請輸入借書證序號:");
scanf("%d",&s);
printf("請輸入可借天數:");
scanf("%d",&d);
for(l=0;l<10;l++)
{
if(books[n].usr[l]==0)
{
books[n].usr[l]=s;
books[n].days[l]=d;
break;
}
}
books[n].store--;
}
if(n!=-1&&books[n].store==0) printf("此書已經全部借出.\n");
return_confirm();
}
/*上面是借書的函數,首先調用找書函數*/
void book_in(void)
{
int n,s,l;
page_title("歸還圖書");
if((n=search_book())!=-1&&books[n].store<books[n].total)
{
printf("借閱者圖書證列表:\n");
for(l=0;l<10;l++)
if (books[n].usr[l]!=0)
printf("[%d] - %d天\n",books[n].usr[l],books[n].days[l]);
printf("請輸入借書證序號:");
scanf("%d",&s);
for(l=0;l<10;l++)
{
if(books[n].usr[l]==s)
{
books[n].usr[l]=0;
books[n].days[l]=0;
break;
}
}
books[n].store++;
}
if(n!=-1&&books[n].store==books[n].total)
printf("全部入藏.\n");
return_confirm();
}
void book_add(void)
{
int n;
page_title("注冊新書");
for(n=0;n<100;n++)
if(books[n].id==0) break;
printf("序號:");
scanf("%d",&books[n].id);
printf("書名:");
scanf("%s",&books[n].name);
printf("作者:");
scanf("%s",&books[n].author);
printf("數量:");
scanf("%d",&books[n].total);
books[n].store=books[n].total;
return_confirm();
}
void book_del(void)
{
int n;
page_title("注銷舊書");
if((n=search_book())!=-1) books[n].id=0;
printf("該書已注銷.\n");
return_confirm();
}
void main(void)
{
menu: page_title("操作選單");
printf("請用數字鍵選擇操作\n\n");
printf("1 借閱圖書\n2 歸還圖書\n\n");
printf("3 注冊新書\n4 注銷舊書\n\n");
printf("\n0 退出\n");
switch(getch())
{
case '1' : book_out();break;
case '2' : book_in();break;
case '3' : book_add();break;
case '4' : book_del();break;
case '0' : exit(0);
}
goto menu;
}
{
int n;
page_title("廣?症慕");
if((n=search_book())!=-1) books[n].id=0;
printf("乎慕廝廣?.\n");
return_confirm();
}
void main(void)
{
menu: page_title("荷恬僉汽");
printf("萩喘方忖囚僉夲荷恬\n\n");
printf("1 処堋夕慕\n2 拷珊夕慕\n\n");
printf("3 廣過仟慕\n4 廣?症慕\n\n");
printf("\n0 曜竃\n");
switch(getch())
{
case '1' : book_out();break;
case '2' : book_in();break;
case '3' : book_add();break;
case '4' : book_del();break;
case '0' : exit(0);
}
goto menu;
}
5. c語言設計學生信息管理系統
發消息給你了
6. C語言程序 如何編寫管理系統
C語言編程的規則
C語言源程序的編程語法歸納如下:
1,強制性規則
1,一個C語言源程序必須有且只有一個MAIN函數.
2,函數名後必須緊跟圓括弧對,函數體放在右圓括弧")"後的花括弧對"{}"中.
3,每個程序體(包括函數的函數體,含有多條語句的選擇結構和循環結構中的語句序列)必須用一對花括弧括起來.
4,文件包含預處理命令,#INCLUDE<*.H應置於源程序的開始位置.
5,語句未尾必須有分號,而預處理命令和函數首部的未尾及右花括弧之後不要分號.
6,同一字母大,小寫意義不同,關鍵字和標准庫函數名必須用小寫.
7,變數必須先定義,後使用
8,除已有明顯間隔符外,標識符,關鍵字之間必須有至少一個空格9,註解必須包含在"/* */符號之間
7. 用C語言設計並實現一個員工信息管理系統
#include<iostream>
#include<cstring>
usingnamespacestd;
typedefstructwage{
charunit[8];
charname[10];
charsex[4];
charbirthdate[12];
chartitle[20];
doublebasewage;
doublesubsidy;
doubletax;
doubleexpenses;
doubleresialwage;
}WAGE;
voidComputerResialwage(WAGEa[],intn){
for(inti=0;i<n;++i)
a[i].resialwage=a[i].basewage+a[i].subsidy-a[i].tax-a[i].expenses;
}
voidPrintTitle(void){
cout<<"單位姓名性別出生年月職稱基本工資津貼個稅水電費實發工資 ";
for(inti=0;i<79;++i)cout<<"*";cout<<endl;
}
voidRowShow(WAGEa[],inti){
cout<<a[i].unit<<"";
if(strlen(a[i].name)==4){
a[i].name[6]=a[i].name[4];
a[i].name[5]=a[i].name[3];
a[i].name[4]=a[i].name[2];
a[i].name[2]=a[i].name[3]='';
}
cout<<a[i].name<<""<<a[i].sex<<""<<a[i].birthdate;
if(strlen(a[i].title)==4){
a[i].title[6]=a[i].title[4];
a[i].title[5]=a[i].title[3];
a[i].title[4]=a[i].title[2];
a[i].title[2]=a[i].title[3]='';
}
cout<<""<<a[i].title<<"";
cout.precision(2);
cout.width(8);
cout<<fixed<<a[i].basewage<<"";cout.width(6);
cout<<fixed<<a[i].subsidy<<"";
cout.width(8);
cout<<fixed<<a[i].tax<<"";
cout.width(6);
cout<<fixed<<a[i].expenses<<"";
cout.width(8);
cout<<fixed<<a[i].resialwage<<endl;
}
voidShow(WAGEa[],intn){
for(inti=0;i<n;++i)RowShow(a,i);
}
voidSearch1(WAGEa[],intn){
inti,flag=1;
for(i=0;i<n;++i){
if(strcmp(a[i].unit,"理學院")==0&&a[i].basewage>900.00&&
strcmp(a[i].title,"副教授")==0&&strcmp(a[i].sex,"男")==0){
RowShow(a,i);
flag=0;
}
}
if(flag)cout<<"(沒找到符合條件者) ";
}
voidSearch2(WAGEa[],intn){
inti,flag=1;
for(i=0;i<n;++i){
if(strcmp(a[i].unit,"理學院")==0&&a[i].basewage<1200.00&&
strcmp(a[i].title,"教授")==0&&strcmp(a[i].sex,"男")==0){
RowShow(a,i);
flag=0;
}
}
if(flag)cout<<"(沒找到符合條件者) ";
}
intmain(){
WAGEa[]={
{"理學院","趙志軍","男","1957-06-25","教授",1150,411,176.6,90},
{"商學院","於銘","女","1979-10-21","助教",500,471,208.9,91},
{"工學院","許炎鋒","女","1954-03-08","教授",1250,630,306.2,96},
{"理學院","王嘉","女","1971-06-06","講師",850,475,100.3,89},
{"工學院","李新江","男","1962-10-02","教授",950,399,49.5,87},
{"商學院","郭海英","女","1963-02-07","副教授",950,332,77.6,85},
{"工學院","馬淑恩","女","1960-06-09","副教授",900,791,60.5,45},
{"理學院","王金科","男","1956-09-10","教授",1050,480,325.6,93},
{"理學院","李東慧","女","1950-08-07","教授",1350,364,52.3,94},
{"工學院","張寧","女","1980-01-01","助教",500,395,78,89},
{"商學院","王孟","男","1966-09-08","講師",800,463,220.3,98},
{"工學院","馬會爽","女","1970-02-09","講師",800,368,101.1,69},
{"工學院","史曉贇","女","1952-06-06","教授",1200,539,520.3,50},
{"理學院","劉燕鳳","女","1959-08-07","教授",1200,892,180.9,86},
{"工學院","齊飛","男","1961-04-05","副教授",1200,626,245.6,74},
{"商學院","張娟","女","1975-09-25","助教",650,374,625.3,86},
{"理學院","潘成文","男","1965-10-09","講師",950,402,1050,90},
{"工學院","邢易","女","1981-02-25","助教",600,325,300,90},
{"商學院","謝梟豪","女","1950-11-18","教授",1350,516,200,90},
{"工學院","胡洪靜","女","1952-06-24","教授",1350,277,100,86},
{"工學院","李雲飛","男","1969-05-04","講師",960,729,56,89},
{"商學院","張奇","女","1970-05-28","講師",960,331,69,89},
{"理學院","夏小波","女","1968-08-01","講師",960,482,89,45},
{"工學院","王瑋","女","1972-11-05","講師",960,340,98,79},
{"理學院","張帝","女","1950-03-26","教授",1300,335,124,90},
{"商學院","孫帥","男","1966-05-24","講師",900,748,326,79},
{"工學院","卜輝娟","女","1960-05-23","教授",960,481,651,78},
{"工學院","李輝玲","女","1978-09-09","助教",630,379,400,77},
{"理學院","劉亞靜","男","1969-08-09","副教授",890,377,23,66},
{"工學院","尹嫻","女","1958-06-09","教授",1050,955,59,65},
{"商學院","馬春英","男","1964-12-06","講師",850,387,78,69},
{"工學院","孟夢","女","1965-08-09","副教授",850,753,485.6,93},
{"工學院","梁曉萌","女","1975-06-09","助教",650,551,136.5,99},
{"理學院","張然","女","1973-03-03","講師",800,761,203.1,100},
{"工學院","彭雁南","男","1978-05-09","助教",650,200,200,90}
};
inti,n=sizeof(a)/sizeof(a[0]);
if(n==0)return1;
ComputerResialwage(a,n);
PrintTitle();
for(i=0;i<n;++i)RowShow(a,i);
for(i=0;i<79;++i)cout<<"*";
cout<<endl;cout<<" 理學院,基本工資高於900元的男副教授有: ";
PrintTitle();
Search1(a,n);
for(i=0;i<79;++i)cout<<"*";
cout<<endl;
cout<<" 理學院,基本工資低於1200元的男教授有: ";
PrintTitle();
Search2(a,n);
for(i=0;i<79;++i)cout<<"*";
cout<<endl<<endl;
return0;
}
8. C語言—精簡設計「學生信息管理系統」
我有這個代碼 給樓主看看吧 希望可以幫上你的忙 http://www.henrysyw.cn/article.asp?id=1078