Student class, transcript

xiaoxiao2021-03-05  29

Please write a "grade" class, each of which can store math, English, and physical scores. Define a "student" class, describe the students' skeeper, name and grade. The score is an embedded object of the "grade" class. "Student" class can set and output all the data of each object.

============================================================================================================================================================================================================= ==========================================================================================================================================================

#include #include using namespace std; class score {int match; int english; int phy; public: score () {math = 0, English = 0, phy = 0;} score (INT A, INT B, INT C) {Math = a, English = B, PHY = C;} ~ score () {} int getmath () {return math;} int getnglish () {return}} int getPHY () {Return PHY;} void changeMath (int M;} void changeeenglish (int e) {English = e;} void change (int P) {phy = p;}}; class student {int SID; char name 30]; score sc; public: student (int S, char * n, score sco) {sID = S; STRCPY (Name, N); sc.changemath (SCHANGEENGLISH (sco.Geenglish) ()); Sc.changeph y (sco.get ());} ~ student () {} void change (int Si) {sID = Si;} void change (char * n) {stracpy (name, n);} void Changesc (Int A, INT B, INT C) {sc.changemath (a); sc.changeenglish (b); sc.changephy (c);} void showid () {cout << SID << Endl;} void showname () {cout <

转载请注明原文地址:https://www.9cbs.com/read-35631.html

New Post(0)