// ********************************************************************
//  Jeff Balsley  10/14/2001										  *
//																	  *
//																	  *
// ********************************************************************
//  Known Bugs:  If you enter a name larger than the string size	  *
//               an error will occur as the program plrints the		  *
//				 string												  *
//																	  *
// ********************************************************************


#include<iostream>
using namespace std;

double get_age_in_hours(double age);
const int hours_per_year = 8760;
int main()
{
	char name[8];
	double age;
	double age_in_hours;
	int i;

	cout << "Please enter your name >";
	cin >> name;

	// check that the last element of the string is the null character
	if (name[7] == '\0'){
		cout << "Is null\n";
	}else{
		name[7] = '\0';
		cout << "now it's null\n";
	}

	for (i=0; i < 8; ++i){
		cout << "name[" << i << "] = " << name[i] << "\n";
	}

	cout << "Please enter your age in years >";
	cin >> age;
	
	age_in_hours = get_age_in_hours(age);

	// print output
		
	cout << "You are " << name << " and you are approximately " 
		<< age_in_hours << " hours old.\n";

	return 0;
}

double get_age_in_hours(double age)
{
	double age_in_hours;
	age_in_hours = hours_per_year * age;

	return (age_in_hours);
}