Given the definitions below. Each occurrence of a const is a promise to the compiler that the compiler will enforce. What is the promise in each case?

```
const int x = 17; //a)
class A
{
public:
A( );
A(int n):
int f( ) const; // b)
int g(const A& x); // c)
private:
int i;
```
What will be an ideal response?


In a) the promise is that any code written by the author will not change x.
In b) the promise is that any code written by the author in the definition of
A::f( )will not change the state of the calling object.
In c) the promise is that any code written by the author in the definition of
A::g(const A&x)will not change the argument in the invocation of this function.

Computer Science & Information Technology

You might also like to view...

What is the Big Oh of the method lighten?

What will be an ideal response?

Computer Science & Information Technology

Given the ShoeType structure type-definition.Write a function for the declaration (prototype).

``` struct ShoeType { char style; double price; }; void setSalePrice(ShoeType& Item, double discountRate); //discountRate =(discounted price)/(regular price) //Adjusts sale price to reflect the specified discount. code}

Computer Science & Information Technology

Modify and print the hierarchy chart representing the Update Hardware menu. The file name in Visio is Update Hardware. Add rectangles to represent the following menu options:

What will be an ideal response?

Computer Science & Information Technology

In the ____________________ mode, objects drawn or moved on top of other objects merge with or segment the existing objects.

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

Computer Science & Information Technology