JavaScript
Caravan Gas
The script should calculate the cost of gas for each car, how many cars were needed, and how filled the last car would be (in percentage). This way they can find the most efficient car that the company should use to transport an x amount of people over an x amount of miles using the least amount of gas and maintaining the most amount of 'seats filled'. The worker should be able to input what cars are available and what their mpg (or in this case killometer per liter) is, how many people must be transported, and the distance in kilometers of the trip. I have translated the output text from spanish to english for consistency, as it was originally written in spanish (hence the kilometers and liter metrics.) The output using the python tutor website is the following:
The code I created: