subject

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.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 21:20
Your program will make use of long long int variables for all calculations. note: the use of long long int requires that you have c++11 support. you should have this automatically if you are using a newer version of visual studio. the support is there for gcc as well, but you may need the -std=c++11 or -std=c++0x compiler flag. you first need to read in the total number of seconds. there is no prompt for the read (that is, you just do the cin without using a cout to display a prompt). this is going to seem a little strange when you are running your program in your ide
Answers: 2
question
Computers and Technology, 21.06.2019 23:30
Me2540 week 5 assignment what do i want to know?
Answers: 1
question
Computers and Technology, 22.06.2019 00:40
If you arrive at the same time as another user straight across from you yield if a. they flash your headlights at you b. you can’t see their turn signals c. you’re going street and they’re running d. you’re turning they’re going straight plz
Answers: 1
question
Computers and Technology, 22.06.2019 02:00
The word ‘play’ comes with many different interpretations and a variety of definitions. discuss some of the various meanings tied to the word play. why is the concept of play thought to be an important addition to the workplace? do some (brief) research online and give an example of how play in the workplace is being done right.
Answers: 2
You know the right answer?
The distance a vehicle travels can be calculated as follows: // // distance=speed time // // for ex...
Questions
question
Mathematics, 09.02.2021 01:00
question
Mathematics, 09.02.2021 01:00