Question: For the following code, which statement is NOT true? class Point { private: double y; double z; public: double x; } ; Question 1 options:

For the following code, which statement is NOT true?
class Point
{
private:
double y;
double z;
public:
double x;
};
Question 1 options:
zis not available to code that is written outside the class.
x,y, andzare called members of the class.
xis available to code that is written outside the class.
The name of the class isPoint.
All of these are true.
Question 2(5 points)
Listen
The following code shows an example of ________.
class Point
{
private:
double y =5.70;
double z =3.0;
public:
Public member functions go here...
};
Question 2 options:
in-place initialization
constructor delegation
a default constructor creation
an illegal initialization
Question 3(5 points)
Listen
In C++11 and later you can have one constructor call another constructor in the same class by using
Question 3 options:
in-place initialization
constructor delegation
a member initialization list
None of these
Question 4(5 points)
Listen
Assume thatmyCaris an instance of theCarclass and that theCarclass has a member function namedaccelerate. Which of the following is a valid call to theacceleratemember function?
Question 4 options:
myCar.accelerate();
Car -> accelerate();
myCar::accelerate();
myCar:accelerate();
None of these
Question 5(5 points)
Listen
What is the output of the following program?
#include
using namespace std;
class TestClass
{
public:
TestClass(int x)
{ cout << x << endl; }
TestClass()
{ cout << "Hello!" << endl; }
};
int main()
{
TestClass test;
return 0;
}
Question 5 options:
The program runs but there is no output.
0
Hello!
The program will not compile.
Question 6(5 points)
Listen
What is the output of the following program?
#include
using namespace std;
class TestClass
{
public:
TestClass(int x)
{ cout << x << endl; }
TestClass()
{ cout << "Hello!" << endl; }
};
int main()
{
TestClass test(77);
return 0;
}
Question 6 options:
The program runs but there is no output.
77
Hello!
The program will not compile.
Question 7(5 points)
Listen
What is the output of the following program?
#include
using namespace std;
class TestClass
{
private:
int val;
void showVal()
{ cout << val << endl; }
public:
TestClass(int x)
{ val = x; }
};
int main()
{
TestClass test(77);
test.showVal();
return 0;
}
Question 7 options:
The program runs but there is no output.
77
0
The program will not compile.
Question 8(5 points)
Listen
When you overload an operator, you cannot change the number of ________ taken by the operator.
Question 8 options:
operations
arguments
operands
parameters
None of these
Question 9(5 points)
Listen
A(n)________ informs the compiler that a class will be declared later in the program.
Question 9 options:
private data member
static function
object conversion
forward declaration
None of these
Question 10(5 points)
Listen
In the following function header, the wordintis known as a(n)________.
FeetInches FeetInches::operator++(int)
Question 10 options:
dummy parameter
incomplete parameter
parameterless data type
incomplete argument
None of these

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 Programming Questions!