Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using a script (code) file, write the following functions: -Write the definition of a function that take one number, that represents a temperature in Fahrenheit

Using a script (code) file, write the following functions:

-Write the definition of a function that take one number, that represents a temperature in Fahrenheit and prints the equivalent temperature in degrees Celsius.

-Write the definition of another function that takes one number, that represents speed in miles/hour and prints the equivalent speed in meters/second.

-Write the definition of a function named main. It takes no input, hence empty parenthesis, and does the following:
- prints Enter 1 to convert Fahrenheit temperature to Celsius
- prints on the next line, Enter 2 to convert speed from miles per hour to meters per second.
-take the input, lets call this main input, and if it is 1, get one input then call the function of step 1 and pass it the input.
- if main input is 2, get one more input and call the function of step 2.
- if main input is neither 1 or 2, print an error message.

-After you complete the definition of the function main, write a statement to call main.

Example of what the code should look like:

def func1(x):
print(x)

def func2(y):
print(y)
print(' ')
print(y)

def main():
func1('hello world')
func2('hello again')

#below we start all the action
main()

Step by Step Solution

3.36 Rating (146 Votes )

There are 3 Steps involved in it

Step: 1

usrbinpython3 def func1f celcius fahrenheit 325 cf3295 ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Precalculus

Authors: Michael Sullivan

9th edition

321716835, 321716833, 978-0321716835

More Books

Students also viewed these Programming questions

Question

Compute the derivative of f(x)cos(-4/5x)

Answered: 1 week ago

Question

Discuss the process involved in selection.

Answered: 1 week ago

Question

Differentiate tan(7x+9x-2.5)

Answered: 1 week ago

Question

Explain the sources of recruitment.

Answered: 1 week ago

Question

Find the sum. 2 + 4 + 6 + ... + 70

Answered: 1 week ago