The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 398 Weeks Ago, 1 Day Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
C++
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.
Hel-----------lo -----------Sir-----------/Ma-----------dam----------- Â----------- -----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------acq-----------uis-----------iti-----------on -----------of -----------my -----------sol-----------uti-----------on.-----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- ca-----------tch-----------