Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Where am I going wrong? C + + is still giving me an error C 2 0 3 3 9 'printStudentInfo':is not a member of
Where am I going wrong?
C is still giving me an error C 'printStudentInfo':is not a member of 'Student'
My Student.H
#ifndef StudentH
#define StudentH
#include
using namespace std;
class Student
private:
std:string name;
std::string id;
int numTests;
double scores;
public:
Constructors
Studentint numTests;
Studentstd::string name, std::string id int numTests;
Deconstructor
~Student;
Mutator Functions
void setNamestd::string name;
voidsetIdstd::string id;
void setScoreint testNum, double score;
Accessor functions
std::string getName;
std::string getId;
double getScoreint n;
int getNumTests;
void printStudentInfo;
;
#endif
Studentcpp
#include "Student.H
#include
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 ;
int Student::getNumTests
return numTests;
void Student::printStudentInfo
std::cout "Name: name ID: id std::endl;
for int i ; i numTests; i
std::cout "Test i Score: scoresi std::endl;
Labcpp#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