/*--------------------------------------------------
created by smtuttle at Tue Nov 8 13:26:10 PST 2016
--------------------------------------------------*/
#include <cstdlib>
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
/*--------------------------------------------------
signature: cheer : int -> int
purpose: expects the number of desired HIPs,
and has the side effect of printing that
many HIPs to the screen, each on its own
line, followed by HOORAY! on its own line,
and it returns the number of HIPs
printed (so, if called with a negative int,
it cheerfully prints HOORAY! and returns a 0)
examples: cheer(3) == 3
and has the side effect of printing to the screen:
HIP
HIP
HIP
HOORAY!
cheer(0) == 0
and has the side effect of printing to the screen:
HOORAY!
cheer(-1) == 0
and has the side effect of printing to the screen:
HOORAY!
--------------------------------------------------*/
int cheer(int num_hips)
{
int count = 0;
while (count < num_hips)
{
cout << "HIP " << endl;
count = count + 1;
}
cout << "HOORAY!" << endl;
return count;
}