Loading...
Please wait while we prepare your content
Welcome to your first JavaScript programming assignments! In this playground, you'll practice writing functions that solve real-world problems. Each question will test your understanding of JavaScript fundamentals including functions, variables, conditionals, and mathematical operations.
Take your time with each problem and make sure you understand the requirements before implementing your solution.
fToC(fDegree) that takes a temperature in Fahrenheit and converts it to Celsius. Formula: (F - 32) * 5 / 9. Return: the Celsius valuecalculateDistance() that multiplies the Earth's diameter (12,742 km) by 30 to simulate the total distance traveled around the planet. Return: the distance value.calculateBMI(height, weight) that calculates Body Mass Index using the formula: weight / (height * height). Height in meters, Weight in kg. Return: a string starts with 'your BMI is' and the result.canDrinkBeer(age) that checks if someone is legally allowed to drink beer in New York (legal age = 21). Return: a message depending on their age and the eligibility. The general format should be: 'You are (age here), you can / cannot drink beer in New York'