function myDogAge() {
var myAge = prompt("Enter your age")
//The first two years of a dog's life count as 10.5 dog years each.
var firstYears = 2 * 10.5;
//Each year following equates to 4 dog years.
var laterYears = (myAge - 2) * 4;
var myAgeInDogYears = firstYears + laterYears;
alert('My age in dog years is ' + myAgeInDogYears + '.');
}