Question: QUESTION 11 In C++, you can pass a variable by reference and still prevent the function from changing its value by using the keyword ____

QUESTION 11

In C++, you can pass a variable by reference and still prevent the function from changing its value by using the keyword ____ in the formal parameter declaration.

a.

automatic

b.

private

c.

static

d.

const

1 points

QUESTION 12

clockType
-hr: int -min: int -sec: int
+setTime(int, int, int): void +getTime(int&, int&, int&) const: void +printTime() const: void +incrementSeconds(): int +incrementMinutes(): int +incrementHours(): int +equalTime(const clockType&) const: bool

The word ____ at the end of several the member functions in the accompanying figure class clockType specifies that these functions cannot modify the member variables of a clockType object.

a.

static

b.

automatic

c.

private

d.

const

1 points

QUESTION 13

class rectangleType { public: void setLengthWidth(double x, double y); //Postcondition: length = x; width = y; void print() const; //Output length and width; double area(); //Calculate and return the area of the rectangle; double perimeter(); //Calculate and return the parameter; rectangleType(); //Postcondition: length = 0; width = 0; rectangleType(double x, double y); //Postcondition: length = x; width = y; private:

double length; double width; };

Consider the accompanying class definition. Which of the following variable declarations is correct?

a.

rectangle rectangleType;

b.

class rectangleType rectangle;

c.

rectangleType rectangle;

d.

rectangle rectangleType.area;

1 points

QUESTION 14

If a function of a class is static, it is declared in the class definition using the keyword static in its ____.

a.

return type

b.

parameters

c.

heading

d.

main function

1 points

QUESTION 15

In C++, the scope resolution operator is ____.

a.

:

b.

::

c.

.

d.

$

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