⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 aaa.cpp

📁 程序说明C++编的程序 可以作为学生管理系统
💻 CPP
📖 第 1 页 / 共 2 页
字号:
	}
}		 
class CStudent: public CBassStudent
{
public:
	CStudent(CBassStudent kfc);
	CStudent(){ Deyujia=rand()%10;
	 Deyujian=rand()%10;
	 Ganbu=10;
	 Qingshi=rand()%10;
	 Zhiyu=rand()%10;
	 Tiyu=rand()%10;
      Deyujifen=0;                                          
      Zhiyujifen=0;                                        
      Tiyujifen=0;                                         
	  SystemScore=0;    
	};
	~CStudent(){};
	int   Deyujia;
	int   Deyujian;
	int   Ganbu;
	int    Qingshi;
	int    Zhiyu;
	int   Tiyu;
	double   Deyujifen;                                          
	double   Zhiyujifen;                                         
	double   Tiyujifen;                                          
	double  SystemScore;                                      
public:
	void   Deyujisuan();
	void   Zhiyujisuan();
	void  Tiyujisuan();
	void   Zongheceping();
	void   Sett();
	void   Gett();

};
void CStudent::Deyujisuan()
{
	Deyujifen=100+Deyujia-Deyujian+Ganbu+Qingshi;
		tfile<<"德育积分:100+"<<Deyujia<<"-"<<Deyujian<<"+"
			 <<Ganbu<<"+"<<Qingshi<<"=="<<Deyujifen<<endl;  
}
void CStudent::Zhiyujisuan()
{
	Zhiyujifen=Jiaquan+Zhiyu;  
	tfile<<"智育积分:"<<Jiaquan<<"+"<<Zhiyu<<"=="<<Zhiyujifen*1.0<<endl;
}
void CStudent::Tiyujisuan()
{
	Tiyujifen=PEStudy+Tiyu;
	tfile<<"体育积分:"<<PEStudy<<"+"<<Tiyu<<"=="<<Tiyujifen<<endl;
}

void CStudent::Zongheceping()
{    
	SystemScore=Deyujifen*0.3+Zhiyujifen*0.6+Tiyujifen*0.1;
tfile<<"综合策评分数为:"<<Deyujifen*0.29<<"+"<<Zhiyujifen*0.59<<"+"<<Tiyujifen*0.12<<"=="<<SystemScore<<endl;
                     }
CStudent::CStudent(CBassStudent kfc)
{
     Deyujia=rand()%20;
	 Deyujian=rand()%20;
	 Ganbu=10;
	 Qingshi=rand()%20;
	 Zhiyu=rand()%20;
	 Tiyu=rand()%20;
      Deyujifen=0;                                          
      Zhiyujifen=0;                                        
      Tiyujifen=0;                                         
	  SystemScore=0; 
}
void CStudent::Sett()
{         
	int  fp,ld,sn,xn,au;
			cout<<"请输入该生德育加分:"<<endl;
			cin>>fp;
			Deyujia=fp;
			cout<<"如果是学生干部,输入干部加分: "<<endl;
			cin>>ld;
			Ganbu=ld;
			cout<<"输入该生的体育加分:"<<endl;
			cin>>sn;
			Tiyu=sn;
			cout<<"输入该生的智育加分: "<<endl;
			cin>>xn;
			Zhiyu=xn;
				cout<<"输入该生的寝室加分: "<<endl;
				cin>>au;
				Qingshi=au;
					cout<<"这位学生信息矫正完毕,谢谢。"<<endl;
			          }
void CStudent::Gett()
{                      }
void main()
{
	 ifstream  wfile("使用说明.txt",ios::in);
	 char dh[110];
	 for(int acer=0;acer<28;acer++)
	 {
		 wfile.getline(dh,120);
		 cout<<dh<<endl;
	 }
	 wfile.close();
	int  djh;//,dj
    cout<<"尊敬的客人,您所获得的是综合策评——经典版"<<endl;
cout<<"现在开始做初始化,请配合:"<<endl;
cout<<"请输入班级学生人数:"<<endl;
//cout<<"please enter the class number of yours:"<<endl;
//cout<<"class name:";
//cin>>dj;
cout<<endl;
cin>>djh;
/*inster information*/
	 int sn;
	 int st=9;
	 int sp=8;
	 int sm=7;
	 tfile<<"//////////////////////////原始成绩/////////////////////////"<<endl;
	 static int i=0;
	 vector<char*>ss;
vector<char*>mm; 
ss.push_back("朱");
	  ss.push_back("叶");
	  ss.push_back("钱");
	  ss.push_back("尤");
	  ss.push_back("杨");
	  ss.push_back("陈");
	  ss.push_back("钟");
	  ss.push_back("李");
	  ss.push_back("付");
	  ss.push_back("林");
mm.push_back("浙江");
mm.push_back("辽宁");
mm.push_back("内蒙");
mm.push_back("黑龙");
mm.push_back("湖北");
mm.push_back("江西");
mm.push_back("甘肃");
mm.push_back("湖南");
mm.push_back("陕西");
mm.push_back("广东");
cout<<"您希望自己输入名字和学号吗?手工输入请按1,系统自动产生请按0  :"<<endl;
int n;
cin>>n;
	if(n==0)
{
		
 int fa,da;
 cout<<endl;cout<<endl;
     for(int rr=0;rr<djh;rr++)
	 {
	   fa=rand()%10;
	   da=rand()%10;
	   if(rr<9)
	   {
    	ofile<<114054<<0<<(rr+1)<<"     "<<ss[fa]<<mm[da];
	    ofile<<"      "<<rand()%10<<rand()%10<<"      "<<87+rand()%10<<"       ";
	    sn=rand()%100;
	   }
	   else{	ofile<<114054<<(rr+1)<<"     "<<ss[fa]<<mm[da];
	   ofile<<"      "<<rand()%10<<rand()%10<<"      "<<87+rand()%10<<"       ";
	   sn=rand()%100;
	   }
      if(sn<60)
	  {
       ofile<<8<<rand()%10;
       ofile<<"     "<<6<<rand()%10;
	  }
       else{
      ofile<<sn;
      ofile<<"     "<<(67+rand()%10);
	   }	
      if(rr%2==0)
	  {
        ofile<<"     "<<st<<rand()%10;
		ofile<<"     "<<sp<<rand()%10;
		ofile<<"     "<<sm<<rand()%10;
		}
		else{
		ofile<<"     "<<rand()%10<<rand()%10;
		ofile<<"     "<<rand()%10<<rand()%10;
		ofile<<"     "<<rand()%10<<rand()%10;
		}
		 ofile<<endl;
	 }
}
else
{
	cout<<" 完全自己输入吗?您希望自己输入多少人的信息?请您指示:(剩余的人员信息将由系统产生)"<<endl; 
int ma;
cin>>ma;
      int aa;
	 char tt[20];
	 int  zz,mp,xx,cc,vv,bb,nn,rr;
	 static int i=0;
for( rr=0;rr<ma;rr++)
{
	 for ( i=0;i<7;i++)
	 {
		 cout<<"依次输入你的学号     你的姓名:"<<endl;
		 cin>>aa>>tt;
		 cout<<"输入你的成绩(共七门)"<<endl;
			cin>>zz;i++;
				cin>>mp;i++;
					cin>>xx;i++;
					cin>>cc;i++;
					cin>>vv;
					cin>>bb;i++;
						cin>>nn;
						i++;
		ofile<<aa<<"     "<<tt<<"      "<<zz<<"      "<<mp<<"       "<<xx;
		ofile<<"     "<<cc<<"     "<<vv<<"     "<<bb<<"     "<<nn;
		 ofile<<endl;
	 }
}
	for( rr=ma;rr<djh;rr++)
	{
	int fa=rand()%10;
	int	da=rand()%10;
	if(rr<10)
	{	aa++;//////////////////////
		ofile<<aa<<"     "
		<<ss[fa]<<mm[da];
	ofile<<"      "<<rand()%10<<rand()%10<<"      "
	<<87+rand()%10<<"       ";
	sn=rand()%100;

	}
	else{
		aa++;////////////////////
		ofile<<aa<<"     "
			<<ss[fa]<<mm[da];
	ofile<<"      "<<rand()%10<<rand()%10<<"      "<<87+rand()%10<<"       ";
	sn=rand()%100;
	
	}
	if(sn<60){
	ofile<<8<<rand()%10;
	ofile<<"     "<<6<<rand()%10;
	}
	else{
	ofile<<sn;
	ofile<<"     "<<(67+rand()%10);
	}	
	if(rr%2==0)
	{
	ofile<<"     "<<st<<rand()%10;
	ofile<<"     "<<sp<<rand()%10;
	ofile<<"     "<<sm<<rand()%10;
	}
	else{
	ofile<<"     "<<rand()%10<<rand()%10;
	ofile<<"     "<<rand()%10<<rand()%10;
	ofile<<"     "<<rand()%10<<rand()%10;
	}
		 ofile<<endl;
	}
}
	ofile.close();
	ofstream ofile("综合策评表.txt",ios::out);
//	CStudent  cos[30];
CStudent *cos=new CStudent[djh];
	ifile.close();
	for(int tan=0;tan<djh*7;tan++)
	{
		canzhao.push_back(chengji[tan]);
	}
	cos[1].ResTop(djh);
	tfile<<endl;
	tfile<<endl;
	cos[1].ResEnd(djh);
	tfile<<endl;
	tfile<<endl;
	cos[1].ResVeriage(djh);
	cos[1].ResUnPsssed(djh);
	tfile<<endl;
	cos[1].CalVeriage(djh);
	  int  me;
		  cout<<"您希望由系统为您产生各科目学分数吗?是请输入1;否输入0"<<endl;
		cin>>me;
	canzhao.push_back(me);
		if(me==0)
		{ 
			 double klo[9]; 
			 cout<<"依次输入七门功课的学分数,请注意务必输入小数哦:"<<endl;
			 klo[8]=0;
			 for(int yp=0;yp<7;yp++)
			 {
			cin>>klo[yp];
		   ewai.push_back(klo[yp]);
			  klo[8]+=klo[yp];
			 }
			 ewai.push_back(klo[8]);
		}
				int fw=0;int sw=0;
			int xx;
			cout<<"您希望由您矫正部分学生的德育,干部,体育,智育 等方面的加减分吗?"<<endl;
             cout<<endl;
			cout<<"接纳请求请输入1; 忽略请求输入0 "<<endl;
			cin>>fw;
			if(fw==1)
			{
				cout<<"请输入您要求修改的学生人数: "<<endl;
				cin>>sw;
				for(int yu=0;yu<sw;yu++)
				{
				cout<<"请输入该学生的学号: "<<endl;
				cin>>xx;
			//
				for(int tt=0;tt<djh;tt++)
				{
					if(xx==xuehao[tt])
					{	cout<<"这位同学是: ";
						cout<<xingming[tt]<<"    "<<endl;
						cos[tt].Sett();
					}
				}
				}
				
			}
		for(int nb=0;nb<djh;nb++)
		{
		tfile<<cos[nb].StudyNumber<<"      "<<setw(6)<<cos[nb].StudentName<<endl;
		cos[nb].FJiaquan(me);
			cos[nb].VJidian(djh);
			cos[nb].Deyujisuan();
		cos[nb].Zhiyujisuan();
		cos[nb].Tiyujisuan();
		cos[nb].Zongheceping();
		tfile<<endl;
		}
		tfile<<endl;
		double *gb=new double[djh];
		int *ak=new int[djh];
		double sak;
		int rcd(0);
		for(int pk=0;pk<djh;pk++)
		{
		gb[pk]=cos[pk].SystemScore;
		}
		int hcb=0,fire;
		int danger,girl;
		for( pk=0;pk<djh;pk++)
		{
			for(hcb=0;hcb<(djh-1);hcb++)
			{
				   if(gb[hcb]>=gb[hcb+1])
				   {
					  sak=gb[hcb];
					 gb[hcb]=gb[hcb+1];
         			gb[hcb+1]=sak;
					}
				else
				{
				rcd=(hcb+1);
				}	
			}	
				ak[pk]=rcd;
		for(fire=0;fire<djh;fire++)
			{
			gb[fire]=cos[fire].SystemScore;
			}
				for(danger=0;danger<(pk+1);danger++)
				{
					girl=ak[danger];
					gb[girl]=0.0;
				}
				rcd=0;
		}
ofile<<"===========================================114054班综合测评决案===========================";
ofile<<"========================================="<<endl;
ofile<<"_______________________________________________________________________________";
ofile<<"____________________________________________________"<<endl;
		 ofile<<"|  "<<"序号    "<<"|  "<<"  姓名  "<<"| "<<" 项目   ";
         ofile<<"|  "<<"平均分    "<<"|  "<<"  奖分 "<<"| "<<" 各项总分   "<<"|  "<<"最后得分    ";
         ofile<<"|  "<<"综合测评得分 "<<"|  "<<" 综合测评名次"<<"| "<<"平均学分基点"<<"|";
		 ofile<<endl;
		 ofile<<"________________________________________________________________________________";
ofile<<"___________________________________________________"<<endl;
int  succ;
int  gay=0;
		for(int gda=0;gda<djh;gda++)
		{
succ=ak[gda];
		switch(gay)
		{
		case 0:{	ofile<<"          "<<"            |"<<"德育积分"<<" |    "
		<<100<<"           "<<cos[succ].Deyujia+cos[succ].Ganbu+cos[succ].Qingshi<<"           "<<cos[succ].Deyujia+cos[succ].Ganbu-
		cos[succ].Deyujian+cos[succ].Qingshi<<"           "<<cos[succ].Deyujifen
		<<endl;}

	case 1:{	ofile<<setw(10)<<cos[succ].StudyNumber<<"    "<<setw(6)<<cos[succ].StudentName<<"  |"<<"智育积分"<<" |    "<<setw(7)<<cos[succ].Jiaquan<<"       "<<setw(2)<<cos[succ].Zhiyu
		<<"        "<<setw(7)<<cos[succ].Jiaquan+cos[succ].Zhiyu<<"       "<<setw(7)<<cos[succ].Zhiyujifen<<"      "<<setw(7)<<cos[succ].SystemScore
		<<"             "<<setw(2)<<gda+1<<"       "<<"     "<<setw(7)<<cos[succ].Jidian<<endl;}

	case 2:{	ofile<<"          "<<"            |"<<"体育积分"<<" |    "<<cos[succ].PEStudy<<"            "<<cos[succ].Tiyu
		<<"           "<<cos[succ].Tiyujifen<<"           "<<cos[succ].Tiyujifen
		<<endl;}
	ofile<<"______________________|_________|_________________________________________________";
	ofile<<"__________________________________________________"<<endl;   
		}
		}
cout<<"好了,现在一切工作都完成了,打开相应文件看看吧!"<<endl;
::WinExec("HH	综合策评表.txt", SW_SHOW);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -