Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Hello! This is C++. Thank you so much for reading this and have a good one! 1. T

ID: 3712308 • Letter: H

Question

Hello! This is C++.

Thank you so much for reading this and have a good one!

1. The destructors in C++ has to be classed for each and every object that has been created in order to destroy them from the memory

T or F

2. When you use an object, the ____ operator, and a non-static function of the object’s class, you actually pass the specific object’s address to the function as an unseen argument.

scope resolution

conditional

dot

address

3.

A convenient way to set all array elements to zero is to declare as follows: int rent[20] = ____;.

0

{0..0}

{0}

{}

5. You ____ a program to detect any possible errors

test

debug

interpret

run

scope resolution

conditional

dot

address

Explanation / Answer

Answers:

1) True: Destructors are used to destroy the memory allocated for the object. User can define a destructor for a class using ~ followed by the class name. Compiler will provide a default destructor in case if no destructor is provided.

2) dot: Dot operator is used to access the members of a class. Compiler finds the method which the object accessing by passing the address as an unseen argument.

3) {0}: By specifying this the array can be initialised by 0 i.e

              int rent[20]={0} the entire array is initialized to 0

4) debug: Basically debugging and testing are same at a basic/initial level but at higher levels testing has much more to do than debugging. Debugging is done manually, test is done automated at higher levels.