Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- #include <iostream>
- #include <cstring>
- #include <string>
- #include <iomanip>
- #include <cstdlib>
- #include "student.h"
- string student::setID(string id)
- {
- stuID = id;
- }
- string student::setName(string name)
- {
- // Setters shouldn't do side effects
- cout << name << endl;
- stuName = name;
- cout << stuName << endl;
- }
- int student::setHPScores(int hpScores[])
- {
- // For "reasons", ptrdiff_t is probably the best choice for
- // iterating over an array. Using the usually suggested
- // unsigned type of size_t inhibits certain optimizations.
- for (int i=0;i<10;i++)
- {
- stuHomeworkParticipationScores[i]=hpScores[i];
- cout << hpScores[i] << endl;
- }
- }
- int student::setTestScores(int tScores[])
- {
- for (int i=0;i<4;i++)
- {
- stuTestScores[i]=tScores[i];
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement