Aqui esta mi solución
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Calculo de consumo</title>
</head>
<body>
<h1>Alcohol o gasolina</h1>
<script>
var tanque = 40;
var kilometros = 480;
var kilometrosAlcohol = 300;
var consumoAlcohol = kilometrosAlcohol/tanque;
var consumo = kilometros/tanque;
document.write("El vehiculo consumio " + consumo + " galones de gasolina en " + kilometros + " kilometros<br><br>");
document.write("El vehiculo consumio " + consumoAlcohol + " litros de alcohol en " + kilometrosAlcohol + " kilometros");
</script>
</body>
</html>