Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javaScript Age in Dog years //write a function that takes your age and returns it to you in dog years - they say that 1 human year is equal to seven dog years function dog Years() javaScript

function calculateDogAge(age) {
    var dogYears = 7*age;
    console.log("Your doggie is " + dogYears + " years old in dog years!");
}

calculateDogAge(1);
calculateDogAge(0.5);
calculateDogAge(12);
Source by www.teaching-materials.org #
 
PREVIOUS NEXT
Tagged: #javaScript #Age #Dog #years #function #takes #age #returns #dog #years #human #year #equal #dog #years #function #dog #javaScript
ADD COMMENT
Topic
Name
3+5 =