Here is an iterative function. Write a recursive function that does the same thing. Be sure you write the correct number of copies of the cheer, “Hip, Hip, Hurray!”. For this problem, ignore namespace issues.
```
void iter_cheers(int n) { for(int i = 0;i < n-1; i++)//this is the tricky part!
cout << "Hip, "; cout << "Hurray!" << endl;
}
```
```
void rec_cheers(int n) { using namespace std; if ( 1 == n ) cout << "Hurray!" << endl; else { cout << "Hip, "; rec_cheers(n-1); } }
```
You might also like to view...
The IllegalArgumentException class extends the RuntimeException class and is, therefore, __________.
a. a checked exception class b. an unchecked exception class c. never used directly d. None of these
Which of these is an advantage of open-ended questions?
A) allows more spontaneity B) gets to the point more quickly C) makes comparing interviews easier D) saves time
Which of the following is FALSE about the table feature in Word 2010?
A) Formatting cap be applied to individual cells. B) The same formatting tools used in a document can be applied to a table. C) Cells of a table can be merged or split. D) Formatting can be applied to an entire table but not to only selected cells.
____ is a symmetric key-encryption technique that will replace the commonly used DES standard.
A. AES B. RC2 C. IDEA D. Blowfish