
Which of the following class definitions is correct in C++?
A) class studentType
{
Public:
Void setData(string, double, int) ;
Private:
String name;
};
B) class studentType
{
Public:
Void setData(string, double, int) ;
Void print() const;
Private:
String name;
Double gpa;
}
C) class studentType
{
Public void setData(string, double, int) ;
Private string name;
};
D) studentType class
{
Public: void setData(string, double, int) ;
Private: string name;
};
Correct Answer:
Verified
Q2: If an object is created in a
Q5: You can use arithmetic operators to perform
Q9: If an object is declared in the
Q10: Figure 2:
class rectangleType
{
public:
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents