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[5];
public:
Student(string name,string major){
this->name = name;
this->major = major;
srand(time(NULL));
for(int i =0; i <5; i++){
grades[i]= rand()%100;
}
}
string getName(){
return this->name;
}
void setName(string name){
this->name = name;
}
string getMajor(){
return this->major;
}
void setMajor(string major){
this->major = major;
}
void getGrades(){
for(int i =0;i <5; i++){
cout<=90){
return 'A';
}
if(score >=80){
return 'B';
}
if(score >=70){
return 'C';
}
if(score >=60){
return 'D';
}
else {
return 'F';
}
}
};
int main(){
Student s("Bob Jones","Computer Science");
cout<<"Name: "<

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!