// Ch9Demo8	
// Wyo C++

// What displays after the following program executes?

#include <iostream>
#include <string>
#include <stdlib.h>		// for rand function
#include <time.h>		// for time function
using namespace std;

int mystery(int incoming);
int whatever(int firstNum, int secondNum);
void sayGoodbye(string incoming);
int getRandom();

int main()
{
	int num1 = 0;
	int total = 0;
	string userName;

	for (int i = 0; i < 5; i++)
	{
		num1 = num1 + 5;
	}
	
	cout << "num1 is " << num1;

	while (total < 40)
	{
		total = total + mystery(total);
	}
	
	cout << "\ntotal is " << total;
	
	cout << "\nThe returned value of the function whatever is " 
<< whatever(num1, total); cout << "\nThe function getRandom returned the value of " << getRandom(); cout << "\nWhat is your name? "; cin >> userName; sayGoodbye(userName); return 0; }// end of main int mystery(int incoming) { return (incoming + 6); }// end of mystery int whatever(int firstNum, int secondNum) { double average = 0.0; average = (firstNum + secondNum) / 2; return average; }// end of whatever void sayGoodbye(string incoming) { cout << "Goodbye " << incoming << "!" << endl; }// end of sayGoodbye int getRandom() { int randomInteger = 0; srand(time(0)); // seeding rand function randomInteger = rand(); return randomInteger; }// end of getRandom