Answered step by step
Verified Expert Solution
Question
1 Approved Answer
How do I fix this error? class Student has no member printStudentInfo here is my Student.H file#ifndef Student _ H #define Student _ H #include
How do I fix this error? "class "Student" has no member "printStudentInfo"
here is my Student.H file#ifndef StudentH
#define StudentH
#include
#include
using namespace std;
const double DEFAULTSCORE ;
class Student
private:
std::string name;
std::string id;
int numTests;
double scores;
public:
Studentint numTests;
Studentstd::string name, std::string Id int numTests;
~Student;
Mutator functions
void setNamestd::string name;
void setIdstd::string id;
void setScore int testNum, double score;
Accessor functions
std::string getName;
std::string getId;
double getScoreint n;
int getNumTests;
;
#endif
Student.cpp
#include "Student.H
Constructors
Student::Studentint numTests
thisnumTests numTests;
scores new doublenumTests;
Student::Studentstd::string name, std::string id int numTests
thisname name;
thisid id;
thisnumTests numTests;
scores new doublenumTests;
Destructor
Student::~Student
delete scores;
Mutator functions
void Student::setNamestd::string name
thisname name;
void Student::setIdstd::string id
thisid id;
void Student::setScoreint testNum, double score
if testNum && testNum numTests
scorestestNum score;
Accessor functions
std::string Student::getName
return name;
std::string Student::getId
return id;
double Student::getScoreint n
if n && n numTests
return scoresn;
else
return ; or any appropriate value to indicate error
int Student::getNumTests
return numTests;
and my main.cpp#include
#include "Student.h
using namespace std;
int main
Student sJohn Doe", s;
ssetScore;
ssetScore;
ssetScore;
ssetNameBuzz;
ssetId;
ssetScore;
ssetScore;
get students' first test score
cout "Name: sgetName Score: sgetScore endl;
cout "Name: sgetName Score: sgetScore endl;
print students info
cout
Studdent ;
sprintStudentInfo;
cout Studdent ;
sprintStudentInfo;
ssetNameJoseph;
ssetScore;
cout
Studdent ;
sprintStudentInfo;
return ;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started