Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using a script ( code ) file, write the following functions: Write the definition of a function that takes one number, that represents a temperature
Using a script code file, write the following functions: Write the definition of a function that takes one number, that represents a temperature in Fahrenheit. The function prints the equivalent temperature in degrees Celsius. point Write the definition of another function that takes two numbers, that represent speed in mileshour and time in minutes. The function prints the distance traveled based on that speed and time. points Write the definition of a function named main. It takes no input, hence empty parenthesis, and does the following: starts by showing on lines using one print statement youll need to use the escape character for the new line the following: Enter to convert Fahrenheit temperature to Celsius Enter to calculate distance travelled Enter to exit uses one input statement to get which number the user wants to input or Call this maininput. Make sure to make maininput an integer. if maininput contains get one input then call the function of step and pass it the input. After this line, call main. if maininput contains get two more inputs and call the function of step and pass it those two inputs; watch out for the order.After this line call main. if maininput contains then print a good bye message. Do not call main, as this will cause us not to exit. if maininput is none of the above, print an error message, then call main. After you complete the definition of the function main, write a statement to call main. points Below is an example of how the code should look like: #Sample Code by Student Name #Created on Some Date #Last Edit on Another Date def funcx: #do some math here to figure out how to convert x Save the result in y Use meaningful name for your variables. printy def funcxy: #do some math here to figure out how to calculate the distance based on x and y Save the result in z Use meaningful name for your variables. printz def main: # print the first three lines as listed in the specs above MI intinput # check if MI then get another input, call it A then call funcA then call main # otherwise check if MI then get two more inputs, call them A and B then call funcAB then call main # otherwise check if MI contains the number then print the good bye message. # otherwise no more checking print an error message, then call main #below we start all the action main Remember to add comments, and that style and best practices will counts towards the points. A program that just "works" is not a guarantee for full credit. Submit your source code file. Back to Module Choose a submission type Drag a file here, or click to select a file to upload Drag a file here, or Choose a file to upload File permitted: PY No file chosen or
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started