Question

3.44 Write a function distance that takes as input a number: the time elapsed (in sec- onds) between the flash and the sound

0 0
Add a comment Improve this question Transcribed image text
Answer #1
In Python:

def distance(n):
    return n * 0.34029


print(distance(3))
Add a comment
Know the answer?
Add Answer to:
3.44 Write a function distance that takes as input a number: the time elapsed (in sec-...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write a program using python that determines the distance to a lightning strike based on the...

    Write a program using python that determines the distance to a lightning strike based on the time elapsed between the flash and the sound of thunder. The speed of sound is approximately 1120 ft/sec and 1 mile is 5280 ft. You need to use a function for this program. It needs to take a single argument and return a single value.

  • USING PYTHON IDLE 3.4: NEED HELP WITH THIS PLEASE! :( Question #8: You want to determine...

    USING PYTHON IDLE 3.4: NEED HELP WITH THIS PLEASE! :( Question #8: You want to determine the distance to lightning strikes during a storm. This can be measured using the time elapsed between seeing the lightning flash and hearing the thunder. You know that the speed of sound is approximately 1,100 ft/second and 1 mile is 5,280 feet. Write a program named q8.py that prompts the user for the number of lightning strikes to analyze and the number of seconds...

  • how do i write a Python program in function. calc_fuel which takes two input parameters: distance...

    how do i write a Python program in function. calc_fuel which takes two input parameters: distance fuel_consumption. The function should calculate : fuel_needed = distance * fuel_consumption / 100. The function should then return fuel_needed. Now add the following lines at the end of main(): distance = 500 fuel_rate = 8 fuel = get_fuel(distance, fuel_rate) print(“Fuel needed is“, fuel)

  • Define a function called “mtok” that takes one input parameter representing a distance in miles and...

    Define a function called “mtok” that takes one input parameter representing a distance in miles and prints out the distance in Kilometers. Assume 1 mile equals 1.5 Km. Example Function Calls: mtok(2) # should print: 2 mile(s) equals 3.0 km mtok(10) # should print: 10 mile(s) equals 15 km

  • Write a stored function that takes a number as its input and returns that number as...

    Write a stored function that takes a number as its input and returns that number as currency, i.e. it should have a leading dollar sign, only have two decimal places, and have commas for the thousands. If the number is negative the result should be in parenthesis, accounting format, -123.45 returns ($123.45). If the input is a non-number, e.g. “Hello”, the function should return $0.00

  • IN PYTHON Write a program that takes a user-input distance and speed and then calculates an...

    IN PYTHON Write a program that takes a user-input distance and speed and then calculates an ETA. Your program should work for ANY COMBINATION of distance and speed.

  • Write a function called productEven that takes as its parameter an input file. The function should...

    Write a function called productEven that takes as its parameter an input file. The function should read two integers and calculate the total product of only even numbers between them. Return the answer to the calling function. c++ program

  • Write a function in the C++called summary that takes as its parameters an input and output...

    Write a function in the C++called summary that takes as its parameters an input and output file. The function should read two integers find the sum of even numbers, the sum of odd numbers, and the cumulative product between two values lower and upper. The function should return the sum of even, odd, ad cumulative product between the lower and upper values. Please write program in C++.

  • Write the following function in Java: A function "makeMangler", that takes as input a list M...

    Write the following function in Java: A function "makeMangler", that takes as input a list M of three numbers. It then builds and returns a "Mangler" function based on M. The "Mangler" function that is produced (by your function makeMangler) would have the property that it takes as input a list, and returns the "mangled" version of that list. "Mangling" a list means doing the following sequence of operations to each item in a list: (1) multiply by the first...

  • Write a function that takes as an input parameter an integer that will represent the length...

    Write a function that takes as an input parameter an integer that will represent the length of the array and a second integer that represents the range of numbers the random number should generate (in other words, if the number is 50, the random number generator should generate numbers between 0 and 49 including 49. The function then sorts the list by traversing the list, locating the smallest number, and printing out that smallest number, then replacing that number in...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT