Object Oriented Programming Using C++ – Section 2


Warning: Undefined variable $ext in /www/wwwroot/gkfeed.com/public_html/wp-content/plugins/show-hidecollapse-expand/bg_show_hide.php on line 281

Warning: Undefined variable $ext in /www/wwwroot/gkfeed.com/public_html/wp-content/plugins/show-hidecollapse-expand/bg_show_hide.php on line 281

Warning: Undefined variable $ext in /www/wwwroot/gkfeed.com/public_html/wp-content/plugins/show-hidecollapse-expand/bg_show_hide.php on line 281

Warning: Undefined variable $ext in /www/wwwroot/gkfeed.com/public_html/wp-content/plugins/show-hidecollapse-expand/bg_show_hide.php on line 281

Warning: Undefined variable $ext in /www/wwwroot/gkfeed.com/public_html/wp-content/plugins/show-hidecollapse-expand/bg_show_hide.php on line 281

26. Which of the following statements uses the computer’s clock to initialize the random number generator?

A. srand(time);
B. srand(time(NULL));
C. time(srand);
D. time(srand(NULL));

Correct Answer:  B. srand(time(NULL));
Advertisement

27. A static data member is given a value

A. within the class definition
B. outside the class definition
C. when the program is executed
D. never

Correct Answer:  B. outside the class definition
Advertisement

28. You must provide a constructor for a derived class

A. always
B. if the base class constructor required arguments
C. if the base class constructor does not require arguments
D. never

Correct Answer:  B. if the base class constructor required arguments
Advertisement

29. If you want to override constructor default values for an object you are instantiating, you must also override

A. all other parameters to that constructor
B. all parameters to the left of that value
C. all parameters to the right of that value
D. no other parameters to that constructor

Correct Answer:  B. all parameters to the left of that value
Advertisement

30. To use one of the C++ built-in mathematical functions, you must include the _____ header file in your program

A. calculation.h
B. compute.h
C. expression.h
D. math.h
E. mathematical.h

Correct Answer:  D. math.h
Advertisement

Warning: Undefined variable $in_same_cat in /www/wwwroot/gkfeed.com/public_html/wp-content/plugins/EXP.GKFEED.COM/function.php on line 27

Warning: Undefined variable $excluded_categories in /www/wwwroot/gkfeed.com/public_html/wp-content/plugins/EXP.GKFEED.COM/function.php on line 27

Leave A Comment?