luhan Write a function that calculates a user BMI. BMI = weight/height2 Your code should request for the user’s weight and height and then return their bmi to them. Your return statement should be "[BMI]kg/m2. P.S: To simplify, use prompt and alert (depending on how your language calls it) when necessary and make sure your code is testable on the Google Chrome console (developer tool)
mccall const weight = prompt("Enter your weight"); const height = prompt("Enter your height"); const bmiCalc = () => { const bmi = weight / Math.pow(height, 2); return `Your BMI is ${bmi}kg/m^2`; }; alert(bmiCalc());
dhtml The solution in python is: def bmi_calc(weight, height): bmi = weight / (height ** 2) return f"Your BMI is {bmi} kg/m^2" weight = float(input("Enter your weight: ")) height = float(input("Enter your height: ")) print(bmi_calc(weight, height))