Suppose we write a function for a class which is not supposed to change any data members in the class. When we test the class, we get a runtime error. After tracking down the source of the runtime error, we realize that this function mistakenly changed the value of a data member. To make things easier, we should have:

A. passed parameters into the function using const reference
B. declared all the data members as constant (using const at the front of their declarations)
C. used const at the end of the function prototype
D. used a Peterson Language Modifier


C

Computer Science & Information Technology

You might also like to view...

Case-Based Critical Thinking QuestionsCase 9-1At the beginning of the academic year, Maxwell was asked to create an HTML form for his tennis coach, Mr. McEnroe, so that he can collect information about the school's tennis team players.Mr. McEnroe also would like to collect information about manufacturers of the racquets that players are using. There are 10 major racquet manufacturers. Which of the following form controls should Maxwell use for this?

A. check box B. drop-down list box C. radio button D. text area

Computer Science & Information Technology

When is the AD RMS service connection point (SCP) defined?

What will be an ideal response?

Computer Science & Information Technology

Infrared Data Association (IrDA) requires _______________, meaning that devices have to be directly facing each other, requires very short distances (sometimes inches) between devices, and has very slow data rates.

A. Near Field Communication (NFC) B. Exchange ActiveSync (EAS) C. line of sight D. geotracking

Computer Science & Information Technology

You can compare two documents to each other, which allows you easily to identify any differences between the two files.

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

Computer Science & Information Technology