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


Answer: A

Computer Science & Information Technology

You might also like to view...

In the ____________________ layout, the default layout manager for frames, you can arrange up to five objects.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

If d is a double and i is an int, then the assignment statement d = i; is legal in Java.

What will be an ideal response?

Computer Science & Information Technology

Choose the element that configures text to be indented from both the left and right margins.

a. blockquote b. p c. h1 d. div

Computer Science & Information Technology

The comment indicator displays:

A) in the lower right corner of the cell. B) in the upper left corner of the cell. C) in the upper right corner of the cell. D) in the lower left corner of the cell.

Computer Science & Information Technology