Solved

Which of the Following Class Definitions Is Correct in C

Question 15

Multiple Choice
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;
};

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:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents