Question: Using this program, is there another way to set accessors and mutators to not use the ( this - - > name ) and also
Using this program, is there another way to set accessors and mutators to not use the this name and also how would I go about changing the name from input? #include
#include
using namespace std;
class Student
private:
string name;
string major;
int grades;
public:
Studentstring name,string major
thisname name;
thismajor major;
srandtimeNULL;
forint i ; i ; i
gradesi rand;
string getName
return thisname;
void setNamestring name
thisname name;
string getMajor
return thismajor;
void setMajorstring major
thismajor major;
void getGrades
forint i ;i ; i
cout
return A;
ifscore
return B;
ifscore
return C;
ifscore
return D;
else
return F;
;
int main
Student sBob Jones","Computer Science";
cout"Name:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
