The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
University
| Teaching Since: | Apr 2017 |
| Last Sign in: | 439 Weeks Ago, 1 Day Ago |
| Questions Answered: | 9562 |
| Tutorials Posted: | 9559 |
bachelor in business administration
Polytechnic State University Sanluis
Jan-2006 - Nov-2010
CPA
Polytechnic State University
Jan-2012 - Nov-2016
Professor
Harvard Square Academy (HS2)
Mar-2012 - Present
True false or multiple choice.
34. Which of the following is the correct preprocessor commands necessary to prevent multiple inclusions of header files? a) #include A????1header.hA????1 b) #define HEADER_HPage 5 #ifndef HEADER_H //declarations for header.h go here #endif c) #ifndef HEADER_H #define HEADER_H // declarations for header.h go here #endif d) #ifndef HEADER_H //declarations for header.h go here #endif
35. A recursive function can have only one stopping case.
36. A recursive function can have only one recursive case.
37. Each recursion causes a new activation frame to be placed on the stack.
38. Each activation frame contains all the functionA????1s code, as well as the automatic variables and formal parameters.
39. The activation frames in nested function calls are handled in a last-in/ first-out order.
40. A binary search works with any array of numbers.
41. How many times is the following code invoked by the call recursive(4)? void recursive( int i ) { using namespace std; if (i < 8) { cout << i << " "; recursive(i); } } a) 2 b) 4 c) 8 d) 32 e) This is an infinite recursion.
42. Give the output of the recursive function below when called with an argument of 5. void recursive( int i ) { using namespace std; if ( i < 8 ) { i++; recursive(i); cout << i << " "; } } a) 6 7 8 b) 5 6 7 c) 8 7 6 d) 7 6 5 e) None of the above. This is an infinite recursion if the function is called with argument 5.
-----------