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

📄 chemistry.cpp

📁 编程序管理学生成绩
💻 CPP
字号:
#include<iostream.h>
#include"chemistry.h"
#include"string.h"
chemistry::chemistry(char *n,int Eng,int Chi,int Mat,int Yjhx,int Hxfx)
{
	strcpy(name,n);
	English=Eng;
	Chinese=Chi;
	Math=Mat;
	yjhx=Yjhx;
	hxfx=Hxfx;
}
char* chemistry::getName()
{
	return name;	
}
int chemistry::getEng()
{
	return English;
} 
int chemistry::getChi()
{
	return Chinese;
}   
int chemistry::getMat()
{
	return Math;
}  
void chemistry::setEng(int x) 
{
	English=x;
}  
void chemistry::setChi(int x) 
{
	Chinese=x;
}  
void chemistry::setMat(int x) 
{
	Math=x;
} 
int chemistry::getTotal()
{
	Total=Math+Chinese+English;
	return Total;
}  
float chemistry::getAverage()
{
	average=Total/3;
	return average;
}  
int chemistry::getMajtotal()
{
	majTotal=yjhx+hxfx;
	return majTotal;
}
float chemistry::getMajave() 
{
	majAve=majTotal/2;
	return majAve;
} 
int chemistry::getyjhx()
{
	return yjhx;
} 
int chemistry::gethxfx()
{
	return hxfx;
} 
void chemistry::setyjhx(int x)//设置有机化学成绩
{
	yjhx=x;
}
void chemistry::sethxfx(int x)  //设置化学分析成绩
{
	hxfx=x;
}
void chemistry::show()
{
	cout<<"学生姓名:"<<name<<endl;
	cout<<"各公共课成绩:"<<English<<"  "<<Chinese<<"  "<<Math<<endl;
	cout<<"平均分和总分:"<<average<<"  "<<Total<<endl;
	cout<<"有机化学成绩:"<<yjhx<<"  "<<"化学分析成绩:"<<hxfx<<endl;
	cout<<"专业课平均分:"<<majAve<<"  "<<"专业课总分:"<<majTotal<<endl;
}

⌨️ 快捷键说明

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