minh co bai nay moi nguoi xem thu thao khao nha!!!!!!!!!
mjnh sap tu da nghe IT nen moi nguoi thoai mai y kien nha!!!!
--------------------------------------
#include<iostream>
class SinhVien
{
private:
char TenSV[30];
char MaSV[6];
char quesv[40];
float DiemLT;
float DiemTH;
public:
float DiemTB;
void SetTen(char ten[]);
char* GetTen();
void SetDiemLT(float LT);
float GetDiemLT();
void SetDiemTH(float TH);
float GetDiemTH();
void SetDiemTB(float TB);
float GetDiemTB();
float TinhTB();
};
void SinhVien::SetTen(char ten[])
{
int i;
for (i=0;ten[i]!='\0';i++) // gan tung ki tu cua xau ten[] cho xau TenSV[]
{ // ki tu '\0' - rong, la ki tu ket thuc cua moi xau.
TenSV[i]=ten[i];
}
TenSV[i]='\0';
}
char* SinhVien::GetTen() //Ham nay tra ra gia tri la 1 xau ki tu
{
return TenSV;
}
void SinhVien::SetDiemLT(float LT)
{
DiemLT=LT;
}
float SinhVien::GetDiemLT()
{
return DiemLT;
}
void SinhVien::SetDiemTH(float TH)
{
DiemTH=TH;
}
float SinhVien::GetDiemTH()
{
return DiemTH;
}
void SinhVien::SetDiemTB(float TB)
{
DiemTB=TB;
}
float SinhVien::GetDiemTB()
{
return DiemTB;
}
float SinhVien::TinhTB()
{
return ((DiemLT + DiemTH)/2);
}
day la lap trinh huong doi tuong do cac pan ak!!!!!
lop nay goi la lop co so, cac pan nho luu ten (.h) nha!!!!!!!