Why is it an error to add a const modifier, as shown to the declaration for the member function input given here?

```
class BankAccount
{
public:
void input( ) const;
// other members
};
```
What will be an ideal response?


If an input routine actually contains code to do input, the function will not compile.
Explanation:
The purpose of and input function is to change the state of the calling object. The
purpose of the const modifier placed as shown is to prevent compiling of code that
changes the state of the calling object.

Computer Science & Information Technology

You might also like to view...

When creating a new layer, what key do you press when clicking the Create new layer icon to bring up the New Layer dialog box used to specify the layer name and other options?

What will be an ideal response?

Computer Science & Information Technology

Enforce referential integrity is one of only two options available when setting a database relationship with another database

Indicate whether the statement is true or false

Computer Science & Information Technology

A user installed a net SOHO router and new wireless NICs to increase his network's transmission speed from 802.11b to 802.11g. He didn't change the router from the manufacture's default settings. The user lives in an apartment building and is still experiencing a slow internet connection after the installations. Which of the follwoing is the most secure option that a technician could implement to resolve this issue?

a. Hide the SSID b. Assign static IP addresses c. Enable MAC filtering d. Disable the WAN port

Computer Science & Information Technology

You need an Internet connection to use Photoshop Help.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology