function showAndCalculateDistance(speed, time) {
for (var i=0; i<5; i++){
var mph = vehicleSpeed* timeTraveled;
return mph
}
var vehicleSpeed = parseInt(prompt('How fast is the vehicle traveling (in miles per hour)? '));
var timeTraveled = parseFloat(prompt('How long has this vehicle traveled (in hours)? '));
var totalDistanceTraveled = showAndCalculateDistance(vehicleSpeed,timeTraveled);
alert('In ' + timeTraveled + ' hours, a vehicle traveling at ' + vehicleSpeed + ' miles/hour will have traveled ' + totalDistanceTraveled + ' miles.');
I want to write the program so it calls the function using a loop to display the number of miles the vehicle traveled for each hour of the time period, and returning the total number of miles traveled