/*-------
Signature: main: void -> int
Purpose: to repeatedly ask the user if they want another
cheer, and if so ask how many hips,
and then show a cheer accordingly,
until they answer n,
and then the program ends
(if they do not answer y or n, the program will
snarkily inquire if they read the instructions
and ask them again)
Examples: if the user enters n when prompted, the
program just ends
if the user enters y then 5 then y then 3
then y then 0 then n when
prompted, the user should see in response:
HIP
HIP
HIP
HIP
HIP
HOORAY!
HIP
HIP
HIP
HOORAY!
HOORAY!
if the user enters b when prompted, then h, then m, then
y then 2 then n, the only cheers will be:
HIP
HIP
HOORAY!
by: Sharon Tuttle
last modified: 2016-12-02
--------*/
#include <cstdlib>
#include <iostream>
#include <string>
#include <cmath>
#include "cheer.h"
using namespace std;
int main()
{
cout << boolalpha;
int desired_num_hips;
char answer;
cout << "do you want a cheer? (y or n): ";
cin >> answer;
while (answer != 'n')
{
if (answer == 'y')
{
cout << "how many hips?: ";
cin >> desired_num_hips;
cheer(desired_num_hips);
}
// want to be snarky if they didn't enter y or n
else
{
cout << "Did you read the instructions?!? y or n!!"
<< endl;
}
cout << "do you want a cheer? (y or n): ";
cin >> answer;
}
return EXIT_SUCCESS;
}