You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
functiontellFortune(jobTitle,geoLocation,partner,numKids){varfuture='You will be a '+jobTitle+' in '+geoLocation+' and married to '+partner+' '+' with '+numKids+' kids.';console.log(future);}tellFortune('bball player','spain','Shaq',3);tellFortune('stunt double','Japan','Ryan Gosling',3000);tellFortune('Elvis impersonator','Russia','The Oatmeal',0);
The Puppy Age calculator
functioncalculateDogAge(age){vardogYears=7*age;console.log("Your doggie is "+dogYears+" years old in dog years!");}calculateAge(1);calculateAge(0.5);calculateAge(12);
The Lifetime Supply calculator
functioncalculateSupply(age,numPerDay){varmaxAge=100;vartotalNeeded=(numPerDay*365)*(maxAge-age);varmessage='You will need '+totalNeeded+' cups of tea to last you until the ripe old age of '+maxAge;console.log(message);}calculateSupply(28,36);calculateSupply(28,2.5);calculateSupply(28,400);
The Geometrizer
functioncalcGeometry(radius){varcircumference=Math.PI*2*radius;console.log("The circumference is "+circumference);vararea=Math.PI*radius*radius;console.log("The area is "+area);}
The Temperature Converter
functioncelsiusToFahrenheit(celsius){varcelsiusInF=(celsius*9)/5+32;console.log(celsius+'°C is '+celsiusInF+'°F');}functionfahrenheitToCelsius(fahrenheit){varfahrenheitInC=((fahrenheit-32)*5)/9;console.log(fahrenheit+'°F is '+fahrenheitInC+'°C');}