?? aaa.cpp
字號:
}
}
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 + -