Ya estoy inscrito ¿Todavía no tienes acceso? Nuestros Planes
Ya estoy inscrito ¿Todavía no tienes acceso? Nuestros Planes
2
respuestas

Gas or Alcohol?

This the result of the proposed exercise in first part of the course (Este es el resultado del ejercicio propuesto en la primera parte del curso)

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>WasteGas</title>
</head>
<body>
    <h3>¿Gas or Alcohol?</h3>
    <script>
        var dist = 480;
        var liter = 40;
        var waste = dist / liter;
        document.write("A car wastes " + waste + " liters of gas per kilometer");
    </script>
    <br>
    <br>
    <script>
        var dist = 300;
        var liter = 40;
        var waste = dist / liter;
        document.write("A car wastes " + waste + " liters of alcohol per kilometer");
    </script>
</body>
</html>
2 respuestas

Great Silvia, the code is very simple, I understand it and I reinforce my reading in English again, thank you.

Thank you for sharing your code with us, I have tested here and the result has been very good.