//******************************************************
// Filename: Compiler_Test.cpp
// Purpose: Average the ages of two people
// Author: Ken Busbee; © Kenneth Leroy Busbee
// Date: Jan 5, 2009
// Comment: Main idea is to be able to
// debug and run a program on your compiler.
//******************************************************
// Headers and Other Technical Items
#include <iostream>
using namespace std;
// Function Prototypes
void pause(void);
// Variables
int age1;
int age2;
double answer;
//******************************************************
// main
//******************************************************
int main(void)
{
// Input
cout << "\nEnter the age of the first person --->: ";
cin >> age1;
cout << "\nEnter the age of the second person -->: ";
cin >> age2;
// Process
answer = (age1 + age2) / 2.0;
// Output
cout << "\nThe average of their ages is -------->: ";
cout << answer;
pause();
return 0;
}
//******************************************************
// pause
//******************************************************
void pause(void)
{
cout << "\n\n";
system("PAUSE");
cout << "\n\n";
return;
}
//******************************************************
// End of Program
//******************************************************