當前位置:首頁 » 編程語言 » c語言實驗室預約登記系統源代碼
擴展閱讀
webinf下怎麼引入js 2023-08-31 21:54:13
堡壘機怎麼打開web 2023-08-31 21:54:11

c語言實驗室預約登記系統源代碼

發布時間: 2022-03-30 01:59:56

⑴ 求一個c語言學生管理系統源代碼

這是我今天寫的一部分代碼,領會精神。建議做鏈表時先畫圖分析一下數據結構,你可以先看一下別人的代碼,先分析別人的代碼,然後試試自己編一個簡單的(沒有參照的編程)。看一下數據結構方面的書會對你學習鏈表有很大的幫助。記著要勤加練習哦!
#include <iostream.h>
#include <fstream.h>
#include <iomanip.h>
#include <windows.h>

static int n;

struct student
{
int stu_number;
char stu_name[10];
char stu_sex[4];
int stu_age;
int math;
int english;
int cplu_plus;
int total;
float average;
};

class stu
{
student boy;
public:
int getnum();
void in_put(student *p1,int num);
void in_file(struct student *p,int number);
void readout(struct student *p);
void A_caculate(struct student *p);
void T_caculate(struct student *p);
int Cacu_aver(struct student *p,int number);
int Cacu_total(struct student *p,int number);
void out_put(struct student *p);

};

void stu::in_put(student *p1,int num)
{
int i;
for (i=0;i<num;i++)
{
cout<<"學號:"<<endl;
cin>>p1[i].stu_number;
cout<<"姓名:"<<endl;
cin>>p1[i].stu_name;
cout<<"性別:"<<endl;
cin>>p1[i].stu_sex;
cout<<"年齡:"<<endl;
cin>>p1[i].stu_age;
cout<<"數學成績:"<<endl;
cin>>p1[i].math;
cout<<"英語成績:"<<endl;
cin>>p1[i].english;
cout<<"c++成績:"<<endl;
cin>>p1[i].cplu_plus;
p1[i].total=0;
p1[i].average=0;
system("cls");
}

}

void stu::in_file(struct student *p,int number)
{
int i;
ofstream ofs("feifei.txt",ios::out);
if (!ofs)
{
cerr<<"can not open the file!"<<endl;
exit(1);
}
else
{
for (i=0;i<number;i++)
{
ofs<<p[i].stu_number<<'\n'
<<p[i].stu_name<<'\n'
<<p[i].stu_sex<<'\n'
<<p[i].stu_age<<'\n'
<<p[i].math<<'\n'
<<p[i].english<<'\n'
<<p[i].cplu_plus<<'\n';

}
cout<<endl<<"data has been writen into the computer!"<<endl;
ofs.close();
}
}

void stu::readout(student *p)
{
int i,m;
ifstream ifs("feifei.txt",ios::in|ios::binary);
if (!ifs)
{
cerr<<"can not open the file!"<<endl;
exit(1);
}
else
{
for (i=0;i<n;i++)
{

}
}
ifs.close();
}

void stu::T_caculate(struct student *p)
{
int i,j;
struct student temp;
for (i=0;i<n;i++)
{
p[i].total=p[i].math+p[i].english+p[i].cplu_plus;
cout<<p[i].stu_name<<"的總成績為:"<<p[i].total<<endl;
}

for (i=0;i<n;i++)
{
for (j=i+1;j<n;j++)
{
if (p[i].total>p[j].total)
{
temp=p[j];
p[j]=p[i];
p[i]=temp;
}
}
}
}

void stu::A_caculate(struct student *p)
{
int i,j;
struct student temp;
for (i=0;i<n;i++)
{
for (j=i+1;j<n;j++)
{
if (p[i].stu_age>p[j].stu_age)
{
temp=p[j];
p[j]=p[i];
p[i]=temp;
}
}
}
}

int stu::Cacu_aver(struct student *p,int number)
{
int i,flag=1;
for (i=0;i<n;i++)
{
p[i].average=(p[i].math+p[i].english+p[i].cplu_plus)/3.0;
if (p[i].stu_number==number)
{
cout<<p[i].stu_name<<"的平均成績是"<<p[i].average<<endl;
flag=0;
}

}
if (flag!=0&&i==n)
{
cout<<"!您輸入的號碼不存在,請查證後重新輸入"<<endl;
}
return flag;
}

int stu::Cacu_total(struct student *p,int number)
{
int i,flag=1;
for (i=0;i<n;i++)
{
p[i].total=p[i].math+p[i].english+p[i].cplu_plus;
if (p[i].stu_number==number)
{
cout<<p[i].stu_name<<"的總成績是"<<p[i].total<<endl;
flag=0;
}

}
if (flag!=0&&i==n)
{
cout<<"-------------------!您輸入的號碼不存在,請查證後重新輸入---------------"<<endl;
}
return flag;
}

void stu::out_put(struct student *p)
{
int i;
cout<<"student's information list here:"<<endl<<endl;
cout<<" "<<setw(10)<<right<<"學號"<<" "<<setw(8)<<left<<"姓名"<<setw(6)<<left<<"性別"<<setw(6)<<right<<"年齡";
cout<<setw(6)<<right<<"數學"<<setw(6)<<right<<"英語"<<setw(6)<<right<<"c++";
cout<<setw(8)<<right<<"總成績"<<setw(10)<<right<<"平均成績"<<endl;
for (i=0;i<n;i++)
{
cout<<"第"<<i+1<<"名"<<setw(10)<<right<<p[i].stu_number<<" "<<setw(8)<<left<<p[i].stu_name;
cout<<setw(6)<<left<<p[i].stu_sex<<setw(6)<<right<<p[i].stu_age<<setw(6)<<right<<p[i].math;
cout<<setw(6)<<right<<p[i].english<<setw(6)<<right<<p[i].cplu_plus;
if (p[i].total!=0)
{
cout<<setw(8)<<right<<p[i].total;
}
if (p[i].average!=0)
{
cout<<setw(10)<<right<<p[i].average;
}
cout<<endl<<endl;
}
}

int main()
{
stu boy;
student *per,*outp;
int m;
cout<<"請從下面的菜單中選出您所要進行的操作選項:"<<endl<<endl;
do
{
cout<<"1.輸入學生信息並保存到文件"<<endl;
cout<<"2.按年齡從大到小顯示學生各項信息"<<endl;
cout<<"3.按各門成績由高到低顯示學生信息"<<endl;
cout<<"4.輸入學號計算學生平均成績並顯示"<<endl;
cout<<"5.輸入學號計算學生總成績並顯示"<<endl;
cout<<"6.按學生總成績排名並顯示排名結果"<<endl;
cout<<"7.退出所在系統"<<endl;
cin>>m;
system("cls");
switch (m)
{
case 1:
{
cout<<"please input the number of students you want to input:"<<endl;
cin>>n;
per=new student[n];
boy.in_put(per,n);
boy.in_file(per,n);
delete []per;
break;
}

case 2:
{
outp=new student[n];
boy.readout(outp);
boy.A_caculate(outp);
boy.out_put(outp);
delete[]outp;
break;
}

case 3:
{
outp=new student[n];
boy.readout(outp);
boy.T_caculate(outp);
boy.out_put(outp);
delete[]outp;
break;
}

case 4:
{
int number,flag;
char flag1;
outp=new student[n];
boy.readout(outp);
do
{
cout<<"please input the number of the students you want to find:"<<endl;
cin>>number;
flag=boy.Cacu_aver(outp,number);
if (flag==1)
{
cout<<"do you want to input again?'Y'/'N'"<<endl;
cin>>flag1;
}
else
break;
}
while (flag1=='y'||flag1=='Y');
boy.in_file(outp,n);
delete[]outp;
break;
}

case 5:
{
int number,flag;
char flag1;
outp=new student[n];
boy.readout(outp);
do
{
cout<<"please input the number of the students you want to find:"<<endl;
cin>>number;
flag=boy.Cacu_total(outp,number);
if (flag==1)
{
cout<<"do you want to input again?'Y'/'N'"<<endl;
cin>>flag1;
}
else
break;
}
while (flag1=='y'||flag1=='Y');
boy.in_file(outp,n);
delete[]outp;
break;

}

case 6:
{
outp=new student[n];
boy.readout(outp);
boy.out_put(outp);
break;
}

}
}
while (m!=7);
return 0;
}

簡單的提示你一下,要自己多聯系的,不然很難學好

⑵ 機票訂購信息管理系統的C語言源代碼,急急急!!!

www.4006510600.com 這是個機票系統 你可以了解下

⑶ 求C語言學生信息管理系統源代碼

給你點建議吧,錄入功能你就用scanf進行錄入,瀏覽功能你可以遍歷你的所有數據,依次輸出即可,查詢最簡單的就是用順序查找,排序可以採用冒泡法

⑷ 用c語言編寫1。電氣系實驗室管理系統(如實驗室查詢、預約、使用等)

你的這個系統比較大呀

⑸ 等級考試報名系統的C語言源程序怎麼寫求幫助

針對你的描述等級考試報名系統的C語言源程序怎麼寫?求幫助,
可以為你提供一份適用於初學者的代碼,
進一步要求可以聯系我們,
聯系我們需要提供你的問題和電子郵件,
有可能幫你,但肯定救急,
請用BaiHi為我留言,

此回復針對所有來訪者和需求者有效,

ES:\\

⑹ 求等級考試報名系統C語言源代碼!!!!!!謝謝

直接買本書不就得了嗎,那麼多源碼誰有啊

⑺ 求C語言的編寫的報名系統,按照功能進行劃分模塊,並給出相應程序源代碼

基於你的描述求C語言的編寫的報名系統,按照功能進行劃分模塊,並給出...,
我們可以為你提供一份適用於初學者的代碼,
進一步要求可以聯系我們,
給我留一個你的問題和Email,
有時間可以幫你,肯定救急,
使用網路_Hi給我留言,

此回復針對所有來訪者和需求者有效,

ES:\\

⑻ 急求!實驗室設備管理系統的C語言代碼!

#include"stdio.h"
#include <conio.h>
#include <stdlib.h>
//#include"FILE.h"
typedef struct shangpin
{
char name[20];
int biaohao;
int shuliang;
double jiage;
}Node;
typedef struct list
{
Node data;
struct list *next;
}List ,*Slist;
void charu(Slist &s,Node x);
int caidan()
{
int i;
while(1)
{
system("cls");
printf("\n\t\t\t 商店銷售管理系統\n\n");
printf("\t\t **********************************************\n\n");
printf("\t\t 1--添加商品 2--出售商品\n\n");
printf("\t\t 3--刪除商品 4--顯示商品\n\n");
printf("\t\t 5--查找商品 0--退出系統\n\n");
printf("\t\t **********************************************\n\n");
printf("請選擇(0-5): ");
scanf("%d",&i);
if(i<6&&i>=0)break;
}
return i;
}
void chushihua(Slist &s)
{
Slist head=new List;
head->next=NULL;
s=head;
}
void tianjia(Slist &s)
{
Node x;
Slist r,p,q;
int i=0;
r=new List;
r->next=NULL;
q=p=s->next;
while(q)
{
i++;
q=q->next;
}
printf("請輸入商品名稱、數量以及價格: ");
scanf("%s%d%lf",x.name,&x.shuliang,&x.jiage);
x.biaohao=i+1;
r->data=x;
s->next=r;
r->next=p;
}
void chu(Slist &s)
{
FILE *cp;//定義文件指針
int i=0;
Node x;

if((cp=fopen("shangpin.txt","a+"))==NULL)//打開文件
{printf("文件打開失敗!");return ;}
fseek(cp,0L,SEEK_SET);//將文件指針移動到文件開頭
while(!feof(cp))
{
fscanf(cp,"%s%d%lf",x.name,&x.shuliang,&x.jiage);//讀取文件的內容
x.biaohao=++i;
charu(s,x);//把讀到的數據插入到鏈表上
}
fclose(cp);//關閉文件
}
void charu(Slist &s,Node x)
{
Slist r,p=s->next;
r=new List;
r->next=NULL;
r->data=x;
s->next=r;
r->next=p;
}
void xieru(Slist s)
{
FILE *cp;//同上
Slist p=s->next;
if((cp=fopen("shangpin.txt","w+"))==NULL)
{printf("文件打開失敗!");return ;}//同上
while(p)
{
fprintf(cp,"%s %d %.2lf ",p->data.name,p->data.shuliang,p->data.jiage);//寫入文件中,並且以空格隔開
p=p->next;
}
fclose(cp);//關閉文件
}
Slist chazhao(Slist s,int m)
{
Slist p=s->next;
if(p==0)return 0;
if(p->next==0)return p;
if(p->data.biaohao==m)return p;
while(p->next)
{
if(p->next->data.biaohao==m)return p;
p=p->next;
}
return 0;
}
void xianshi(Slist s)
{
Slist p;
p=s->next;
printf("%10s%20s%10s%10s\n","商品編號","商品名稱","商品數量","商品價格");
while(p)
{
printf("%10d%20s%10d%10.2f\n",p->data.biaohao,p->data.name,p->data.shuliang,p->data.jiage);
p=p->next;
}

}
void shanchu(Slist &s)
{
}
void chushou(Slist &s)
{
}
void main()
{
int num;
Slist s;
chushihua(s);
chu(s);
num=caidan();
while(1)
{

switch(num)
{
case 0:exit(0);break;
case 1:tianjia(s);break;
case 2:chushou(s);break;
case 3:shanchu(s);break;
case 4:xianshi(s);break;
case 5:chazhao(s,1);break;
}
printf("按任意鍵繼續!");
getch()();
num=caidan();
}
xieru(s);
}

⑼ 急求 c語言學生信息管理系統源代碼 在線等

我以前寫了個在空間裡面,現在沒時間改,你可以自己參考下,實現了你要的功能,就是只可以統計一科成績,641164095

⑽ 學生信息管理系統c語言源代碼,跪求源代碼

20RMB代做,全網最低