Question: In class, by using setter and getter methods, write a program in C++ that defines a class called Student and private fields are studentId type
In class, by using setter and getter methods, write a program in C++ that defines a class called Student and private fields are “studentId” type interget, ”studentName” of type string and ”cgpa” type of double. The class also has display function to prints the student information. Use this keyword to set and get the values of member variables.
Step by Step Solution
3.45 Rating (142 Votes )
There are 3 Steps involved in it
include using namespace std class Student private int studentId string studentName double cgpa pub... View full answer
Get step-by-step solutions from verified subject matter experts
