Skip to content

Instantly share code, notes, and snippets.

@georgeportillo
Last active September 10, 2017 03:50
Show Gist options
  • Save georgeportillo/cf994c98b83b7ece6d294a5fe48abf3c to your computer and use it in GitHub Desktop.
Save georgeportillo/cf994c98b83b7ece6d294a5fe48abf3c to your computer and use it in GitHub Desktop.
function init() {
// Ask user for input, store in userKilometers.
let userKilometers = display('How many kilometers to convert?')
// Get amount of miles from the amount of kilometers, store in convertedMiles.
let convertedMiles = milesTotal(userKilometers);
// Display the amount of miles.
display('You have driven ${convertedMiles} in total!')
}
function milesTotal(userKilometers)
// The main and only worry of this function is to processMiles.
return userKilometers * (0.6214);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment