To quote Griff... We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.
However, it looks like you have taken a stab at it. What is missing are controls to allow the input / selection of the data and a button or something to fire the function to perform the calculation. Not knowing the exact requirements, here is a solution in its most basic form (without any styling).
<!DOCTYPE html>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script type="text/javascript">
function lengthConverter(valNum) {
var length;
length = document.getElementById('selLength').value;
if (length=='cm') {
valNum = valNum*2.54;
}
if (length=='ft') {
valNum = valNum*0.0833;
}
if (length=='yd') {
valNum = valNum*0.02778;
}
valNum = valNum.toFixed(2);
var resultsString = "<h2> Your measurement is "+ valNum +" </h2>";
document.getElementById('results').innerHTML = resultsString;
}
</script>
<html>
<body>
Value: <input type="text" id="valueToConvert" size="8" >inches<br/>
<input type="button" value="Convert To" onclick="var val=document.getElementById('valueToConvert').value;lengthConverter(val)">
<select id="selLength">
<option value="cm">Centimeter</option>
<option value="ft">Foot</option>
<option value="yd">Yard</option>
</select>
<div id="results">
</div>
</body>
</html>
Good luck to you in your course, and happy coding. Since you are new to CP, please accept solution / vote up if it works for you.