student.cpp

来自「C++开发的学生信息管理系统」· C++ 代码 · 共 66 行

CPP
66
字号
//*******************************************
//*******************************************
//************                   ************
//************  STUDENT SYSTEM   ************
//************                   ************
//*******************************************
//*******************************************





#include<process.h>
#include<iostream.h>
#include<bios.h>
#include<stdlib.h>
#include<string.h>
#include<conio.h>
#include<stdio.h>
#include<iomanip.h>

#define key_1   561
#define key_2   818
#define key_3   1075
#define key_4   1332
#define key_5   1589
#define key_6   1846
#define key_7   2103
#define key_8   2360



class Mark    //define class Mark.
{ public:
   Mark(int rchinese=0,int rmath=0,int renglish=0)
     {
      chinese=rchinese;
      math=rmath;
      english=renglish;
      }
   void getaverage()//calculate the average of three subject.
     {
      average=(chinese+math+english)/3;
     }
   int chinese;
   int math;
   int english;
   int average;
 };

class Student //define class Student.
{ public:
   Student(char*cname="noname",int cnumber=0,int cchinese=0,int cmath=0,int cenglish=0):mark(cchinese,cmath,cenglish)
     {strncpy(name,cname,sizeof(name));
      name[sizeof(name)-1]='\n';
      number=cnumber;}
   Student(Student& s)
     {strcpy(name,s.name);
      number=s.number;
      mark.chinese=s.mark.chinese;
      mark.math=s.mark.math;
      mark.english=s.mark.english;
      mark.average = s.mark.average;}
   void view()
     {   cout<<"谀哪哪哪哪哪哪哪哪穆哪哪哪哪哪穆哪哪哪哪哪履哪哪哪哪穆哪哪哪哪哪履哪哪哪哪目"<<endl;
	 cout<<"

⌨️ 快捷键说明

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