Computers and Technology

The distance a vehicle travels can be calculated as follows: // // distance=speed time // // for example, if a train travels 48 miles per hour for three hours, the distance // traveled is 120 miles. write a program that asks the user for the speed of a // vehicle (in miles per hour) and the number of hours it has traveled. it should // then call a function that uses a loop to display the number of miles the vehicle // has traveled for each hour of that time period and returns the total number of // miles traveled. / function showandcalculatedistance( speed, time) { / 25 26 // insert your code between here and the next comment block. do not alter // any code in any other part of this file. 28 31 // insert your code between here and the previous comment block. do not alter / 32 // any code in any other part of this file. 34 } 35 36 37 38 39 40 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(vehiclespe ed, timetraveled); alert('in ' + timetraveled + ' hours, a vehicle traveling at ' + vehiclespeed + ' miles/hour will have traveled ' + totaldistancetraveled + ' miles.

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 04:00, paige1614
When you collaborate or meet with a person or group online, it is called
Answers: 1
image
Computers and Technology, 25.06.2019 03:10, lokiliddel
Write a program to convert a person's height in inches into centimetres #and their weight in stones into kilograms. (1 inch = 2.54 cm and 1 stone = 6.364 kg)
Answers: 1
image
Computers and Technology, 25.06.2019 03:30, eamber646
Which task should happen during the planning stage of a project
Answers: 2
image
Computers and Technology, 25.06.2019 04:00, saggirl1209
Use the wrap text icon to modify which graphic appears in the front of layered images modify the picture effects change the way text is wrapped around an object apply wordart to the text
Answers: 1
Do you know the correct answer?
The distance a vehicle travels can be calculated as follows: // // distance=speed time // // for ex...

Questions in other subjects: